Just opening this issue in case anyone has run into a similar problem. This is not technically an issue with the crumbs module itself, but since it's the only module that uses hook_module_implements_alter in this "creative" way this feels like an appropriate place to file this for now.
The issue is that crumbs_module_implements_alter() is not running for us under certain circumstances. It is yet to be determined what the cause is, as we can only reproduce this on a system with all other kinds of caching, where after a cache clear, crumbs_module_implements_alter() will only run if we have a low realpath_cache_size value.
As the require_once for crumbs.info.inc (with the theme hooks in it) only happens whenever module_implements() runs, the crumbs_theme hook doesn't get picked up and we get empty breadcrumbs.
For now it seems like the drupal_alter cache isn't cleared correctly, as it only considers the module_implements_alter() implementations for "bootstrap" modules, as described in #496170: module_implements() cache can be polluted by module_invoke_all() being called (in)directly prior to full bootstrap completion.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 2488208-19.patch | 2.13 KB | stefan.r |
| #12 | 2488208-12.patch | 2.17 KB | stefan.r |
| #9 | 2488208-9.patch | 2.01 KB | stefan.r |
| #6 | 2488208-5.patch | 19.13 KB | stefan.r |
| #2 | 2488208-2.patch | 533 bytes | stefan.r |
Comments
Comment #1
stefan.r commentedOne of the issues with this might be: #496170: module_implements() cache can be polluted by module_invoke_all() being called (in)directly prior to full bootstrap completion
Comment #2
stefan.r commentedOne way to fix this would be this patch, but that feels like hack upon hack upon hack :)
The cleanest way may be to just put the Drupal hook implementations back into crumbs.module.
Or alternatively, as the dynamic include file loading that happens in
crumbs_module_implements_alter()is clever, but this is the first module to try this, it's doing it in a way unsupported by core, and fakes hook_hook_info() data: perhaps just requiring all of hook/help/form files on every request (the way we do with crumbs.callbacks.inc and crumbs.block.inc) might be better?Comment #3
donquixote commentedHi!
I am ready to drop the "creative" use of hook_module_implements_alter(), once I understand what is going on there.
Comment #4
stefan.r commented@donquixote thanks. That was not a criticism by the way, I actually thought it was quite clever ;)
I think we just stumbled upon a nasty core bug, the complaints in the issue in #1 sound similar. I'll report back when I find out more in a week or so.
Comment #5
stefan.r commentedThis moves the hook implementations back into the .module file. I realize it becomes a "longer" file, but on the other hand, that's the case for the large majority of Drupal modules anyway :)
In my particular case the hook_module_implements_alter() issue is still unexplained as of yet, it seems to be happening due to a core bug (#496170: module_implements() cache can be polluted by module_invoke_all() being called (in)directly prior to full bootstrap completion, which links to several other critical issues), where on some installs the module_implements cache can become unreliable. This means the Crumbs module breaks quite badly as it relies on its hook_module_implements_alter() implementation being available to even display the breadcrumbs.
Comment #6
stefan.r commentedComment #7
donquixote commentedI just had a look at the core issue, #496170: module_implements() cache can be polluted by module_invoke_all() being called (in)directly prior to full bootstrap completion
So, if I understand correctly.
module_implements($hook)being called fromhook_boot().The
$hooktypically has nothing to do with Crumbs, it can be any random hook.module_implements('module_implements_alter')to be called.hook_module_implements_alter().At this time,
crumbs.moduleis not included yet.Therefore, for the rest of the request, Drupal assumes that crumbs does NOT implement
hook_module_implements_alter().Your analysis (also what you sent me by email) is spot-on.
We should also update this stackexchange question:
http://drupal.stackexchange.com/questions/108884/hook-module-implements-...
Comment #8
donquixote commentedAs for your patch in #6:
Since I am already working on 7.x-3.x, I would prefer to simply do require_once from the module file, to reduce noise in git history.
Yes, I can see how putting it all in the module file could be preferable, but atm I feel that less noise = easier merging = better.
Comment #9
stefan.r commentedComment #10
donquixote commentedGreat!
Maybe a comment,
Comment #11
stefan.r commentedComment #12
stefan.r commentedComment #16
stefan.r commentedRe-queueing in case this was a testbot issue.
Comment #18
donquixote commentedYes, it was a testbot failure the first time. But not this time :)
These files don't live in "includes" subfolder..
(The "creative" hook_module_implements_alter() would not have worked with files in a subfolder)
Comment #19
stefan.r commentedha :)
Comment #21
donquixote commented