Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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!
Comment | File | Size | Author |
---|---|---|---|
#18 | mobile-tools-1177548-14.patch | 474 bytes | smira |
Comments
Comment #1
twom CreditAttribution: twom commentedHi,
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
Comment #2
AlfTheCat CreditAttribution: AlfTheCat commentedHi 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!
Comment #3
Paul_Gregory CreditAttribution: Paul_Gregory commentedI'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
Comment #4
AlfTheCat CreditAttribution: AlfTheCat commentedHi Paul,
thanks for the var_dump :)
Comment #5
twom CreditAttribution: twom commentedAt 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.
Comment #6
bkosborneFYI, 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.
Comment #7
bkosborneIf 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.
Comment #8
gregglesI was just bitten by this. It happened when I enabled 6.x-2.x-dev version of the module.
Comment #9
twom CreditAttribution: twom commentedThis 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!
Comment #10
twom CreditAttribution: twom commentedComment #11
gregglesWhat 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.
Comment #12
AlfTheCat CreditAttribution: AlfTheCat commentedMet 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.
Comment #13
gregglesI may have enabled via drush. Perhaps something about drush/feature enabling causes this to happen?
Comment #14
twom CreditAttribution: twom commentedHi 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?
Comment #15
twom CreditAttribution: twom commentedOk, this is similar to #1177548: Error on activating which I was able to reproduce... See if a solution comes up..
Comment #16
carn1x CreditAttribution: carn1x commentedI am having this problem too, downloaded with drush, enabled with modules page.
Comment #17
cpliakas CreditAttribution: cpliakas commentedI 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.
Comment #18
smira CreditAttribution: smira commentedSteven 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
Comment #19
craigmc CreditAttribution: craigmc commentedReviewed and addresses the issue in my D6/apache/Varnish stack.
Comment #20
mukil CreditAttribution: mukil commentedregarding 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.
Comment #21
minorOffense CreditAttribution: minorOffense commentedCommitted to dev branch.