During a pageload where the cache had been emptied just before, if a module is installed that calls module_implements(some_hook) before all modules that implement some_hook are loaded, only the then-loaded modules get cached by module_implements.
Subsequently, when all modules are loaded, drupal does not fix this cache, since the cache is no longer empty.
This causes modules like token to break utterly, since they rely on a module_implements_alter hook.
| Comment | File | Size | Author |
|---|---|---|---|
| flush-cache.patch | 557 bytes | huf |
Comments
Comment #1
catchCalling module_implements() before all modules are loaded isn't really supported, that's what bootstrap_invoke_all() is for.
On the other hand lots of code does unfortunately do this.
The easiest way to fix this would be to prevent module_implements() writing to cache if it has a cache miss before a full bootstrap, then the cache won't be corrupted. The ThemeRegistry class does this since similar problems can happen with early calls to theme(). We should also update the module_implements() cache to use DrupalCacheArray - or move the logic into the new Extensions class. the CacheArray conversion could be backported to 7.x.
Comment #2
Growiel commentedi wonder if this is the same problem as #1934192: hooks disappear from module_implements cache, maybe one module invokes module_implements "too early" and as such the other form_alter disapear.
Comment #3
catchThis is similar to #534594: [meta] system info cache writing and registry rebuilding is broken without a full bootstrap.
Comment #4
dcam commentedhttp://drupal.org/node/1427826 contains instructions for updating the issue summary with the summary template.
Comment #5
catchThis is fixed in 8.x.
#1934192: hooks disappear from module_implements cache is a Drupal 7 issue with more background, marking this as duplicate.