I get this error when I export mobile tools with features.

My feature contains simply the mobile_tools module and the mobile user roles submodule as a dependency. On activation of the feature, it breaks the site and a WSOD appears with the above stated fatal error.

This happens with both the 2.2 version and the latest dev.

Any thoughts on this? Thanks in advance!

CommentFileSizeAuthor
#18 mobile-tools-1177548-14.patch474 bytessmira
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

twom’s picture

Assigned: Unassigned » twom

Hi,

Thank you for the bug report. In order to help me debugging the problem, can you do a var_dump on the plugin object:

var_dump($plugin)

I am not sure what the issue is, but I have the impression that the context plugin is not yet loaded by context.

Thx,
Tom

AlfTheCat’s picture

Hi Tom,

Thanks for your reply, I've never done a var_dump, could you give me some pointers on how to do this? I'll report back instantly.

Thanks!

Paul_Gregory’s picture

I'm hitting the same problem. I'll respond on the behalf of the original poster.

A var_dump() on $plugin:
bool(false)

I see this comes immediately after trying to include the context plugin 'mobile' but that plugin is missing from the Plugins folder in mobile_tools. It's there in the Drupal6 branch. I tried placing mobile_tools_context_condition_mobile.inc from the Drupal6 version in the plugins directory but I can't seem to get the file to be included.

Paul

AlfTheCat’s picture

Hi Paul,

thanks for the var_dump :)

twom’s picture

Status: Active » Needs work

At this point I added a fix to the module to check if $plugin is an object.

The problem seems to be that the plugin is not in the context registry. Enabling/disabling the module should normally be enough to fix this.

bkosborne’s picture

FYI, I was unable to disable the module using drush/modules admin page. Had to go thru manually in the system table to turn it off.

bkosborne’s picture

If it helps, I'm working on a mobile version of a site in Git and often switch back to the main branch to make updates. When I switch back to the mobile branch to continue updates, I get the error and must disable & enable the module manually.

greggles’s picture

Priority: Normal » Critical

I was just bitten by this. It happened when I enabled 6.x-2.x-dev version of the module.

twom’s picture

This error can occur when upgrading the module between versions that do not contain the context plugin and the latest versions. The reason is that the mobile tools never was registered, but the code expects the mobile tools context plugin to be fully operational.

Simple solution is to enable/disable mobile tools.

If the problem persists, let me know!

twom’s picture

Status: Needs work » Needs review
greggles’s picture

What needs review here? There's no patch to apply/test, but I feel like something that can cause a WSOD should be protected against.

For the site where I had this problem we hadn't previously enabled mobile_tools ever, though we did have context and ctools installed already.

AlfTheCat’s picture

Met too, just as with @greggles, Ctools and Context were already enabled on the site. Manual install of the module works fine, if it is installed through the enabling of a Feature though, the WSOD happens.

greggles’s picture

I may have enabled via drush. Perhaps something about drush/feature enabling causes this to happen?

twom’s picture

Status: Needs review » Needs work

Hi guys,

I tested locally by enabling Mobile Tools after Ctools and Context where already enabled, and I cannot reproduce the error using drush to enable the module.

I have tried the module version from -dev to -2.2 with context enable... but no WSOD.

However, I noticed that somehow the context plugin got missing in the last dev version... And of course this causes a fatal error. But since this bug got in on june 5th, this would have nothing to do with the error you have been reporting.

Did you find a way to get rid of WSOD?

twom’s picture

Ok, this is similar to #1177548: Error on activating which I was able to reproduce... See if a solution comes up..

carn1x’s picture

I am having this problem too, downloaded with drush, enabled with modules page.

cpliakas’s picture

I am getting the same error, and I noticed that the issue posted at #1177548: Error on activating is the causing the fatal error as mentioned in #15 above. Seems like a duplicate to me.

smira’s picture

Status: Needs work » Needs review
FileSize
474 bytes

Steven Jones's patch from #1177548: Error on activating applies cleanly to D6 version and fixes the issue on my OpenAtrium / BOA (nginx+aegir) installation.
Re-upping it here to be reviewed and committed.
Credit of course goes to Steven Jones

craigmc’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed and addresses the issue in my D6/apache/Varnish stack.

mukil’s picture

regarding the provided patch, the committer should consider making use of is_object($object) instead of checking for an object through using empty($object) - see http://php.net/manual/de/function.is-object.php and http://php.net/manual/de/function.empty.php

as a sidenote: the mentioned workaround of enabling/disabling the module does surely not work when this module is activated as part of an installation profile.

minorOffense’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Committed to dev branch.