Closed (duplicate)
Project:
Features
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Oct 2011 at 21:31 UTC
Updated:
30 Sep 2014 at 19:38 UTC
Jump to comment: Most recent
Comments
Comment #1
emarchak commentedI'm on the latest dev version of Features, and none of the patches will correct this error for me.
Comment #2
fearlsgroove commentedTriggering this bug requires having something call menu_get_item() in hook_custom_theme (or possibly hook_init -- something before full boostrap). Domain_theme from Domain was the module that made me look into this.
This problem occurs because features_load is invoked by menu_get_item() since the feature object is the menu argument. Inside the feature_load chain is system_rebuild_module_info. If a module calls menu_get_item in a pre-bootstrap hook like custom_theme (which domain theme does), it will attempt to load the feature, which triggers the module info rebuild. At least the field module, and possibly many others, call theme functions or functions that depend on theme calls (i.e.
l()) during the module rebuild. Since theme initialization hasn't happened, the theme gets pre-initialized as the default regardless of what custom_theme hook invokes set.I have no idea whether to blame domain for calling menu_get_item before initialization, features for calling system_rebuild_module_info as part of an entity load function or core for allowing API calls to exist that can't safely be called from hooks that core also provides pre bootstrap.
Comment #3
agentrickardHm. That sounds like a bug in Features still.
Comment #4
agentrickardWe fixed this over in DA.
Comment #5
devuo commentedThis problem still exists, and must be solved within the scope of the Features module. Features breaking due to the use menu_get_item() with an implementation of hook_custom_theme() is quite restricting.
Comment #6
mpotter commentedDrupal is invoking menu_get_item in order to execute the path /admin/structure/features/FOO (Drupal needs to load the FOO feature to pass is to the menu hook). This happens with any path that uses menu arguments, such as %feature or %node (loads a node). Drupal calls feature_load in order to load the feature object.
In order to load a feature, Features must call system_rebuild_module_info in order to get the module file list to loop through. I don't see any other Drupal core API function to return the list of module files.
So my question back is what is being done in your hook_custom_theme() that is interfering with this as it sounds like this was fixed with Domain already? Sounds like you are calling something too early in the bootstrap order.
Unfortunately I don't see anything I can do in Features to help with this, but if somebody wants to post a patch solution, I'll take a look.
Comment #7
agentrickardIn Domain, we fixed this with #1419090: Domain theme, admin theme broken broken for certain paths in Features module. Anything that causes this error and _does not_ use DA needs to be properly reported and validated by @devuo.
My understanding is that menu_get_item() is unreliable when any module uses AJAX on a page.
Comment #8
wiifmI was having the exact same issue, managed to follow @agentrickard's advice and apply the fix:
And now I finally get the admin theme when re-creating features. Would be keen on a features/core patch here, rather than a contrib module hack.
Comment #9
agentrickardI think it's a core issue. I used to have the same problem with AJAX from the Media module. You should open a core bug.
Comment #10
jeffschulerCross-referencing #2347825: CustomError causing admin pages to appear in default theme, where the same issue occurs with the CustomError module due to a call to
menu_get_item()fromhook_custom_theme().