Commit 0a5d9dd3 authored by Dries's avatar Dries

- Patch #836630 by catch: module_implements() caching is broken.

parent e34b8526
......@@ -586,6 +586,9 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) {
}
if (!isset($implementations[$hook])) {
// The hook is not cached, so ensure that whether or not it has
// implementations, that the cache is updated at the end of the request.
$implementations['#write_cache'] = TRUE;
$hook_info = module_hook_info();
$implementations[$hook] = array();
$list = module_list(FALSE, FALSE, $sort);
......@@ -593,8 +596,6 @@ function module_implements($hook, $sort = FALSE, $reset = FALSE) {
$include_file = isset($hook_info[$hook]['group']) && module_load_include('inc', $module, $module . '.' . $hook_info[$hook]['group']);
if (module_hook($module, $hook)) {
$implementations[$hook][$module] = $include_file ? $hook_info[$hook]['group'] : FALSE;
// We added something to the cache, so write it when we are done.
$implementations['#write_cache'] = TRUE;
}
}
// Allow modules to change the weight of specific implementations but avoid
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment