Invoking other hooks from hook_boot() may cause inconsistent behavior on other modules. Pathauto is just an example of this #1574520: Dev version breaks Pathauto patterns admin page.
Also, it seems not to be a good practice, see #496170: module_implements() cache can be polluted by module_invoke_all() being called (in)directly prior to full bootstrap completion
So we need to fix this in variable_realm module, which uses hook_variable_realm_controller(). Other variable hooks may also cause issues, since hook_variable_info() is invoked from variable_get_value() and that function should be ideally bootstrap-safe.
We need to research options but basically the solution may be rewriting hook invocation for not to use module_invoke_all() nor module_implements().
Comments
Comment #1
jose reyero commentedFirst patch committed which:
- Uses _variable_realm_invoke_all(), which is a bootstrap-safe version of module_invoke_all.
- Removes hook_variable_realm_info_alter(), which also is not good during bootstrap
Comment #2
Pls commentedCan you please attach this patch so we can review and report you some feedback? Thanks!
Comment #3
jose reyero commentedhttp://drupalcode.org/project/variable.git/commit/2092dab
Comment #4
rimen commentedThanks! Patch work for me! (I had a problem with pathauto).
Comment #5
bforchhammer commentedUsing current dev version, I still get an incomplete form on the pathauto pattern page... For me only the "default node pattern" is shown; all the other ones (node-type specific, user, taxonomy) are not displayed.
Comment #6
jose reyero commented@bforchhammer,
Have you tried refreshing the cache? or disabling and enabling the module?
Comment #7
bforchhammer commentedYes, both.
Comment #8
bforchhammer commentedAlright, I've debugged this a bit more and found out that my pathauto page only breaks when I enable the domain_variable module. Looks like this needs a fix in domain_variable, so as far as variable is concerned this can probably be considered fixed.
New issue in domain_variable queue: #1686154: Module breaks pathauto pattern form.
Comment #9
jose reyero commentedOk