diff --git a/core/lib/Drupal/Core/ExtensionHandler.php b/core/lib/Drupal/Core/ExtensionHandler.php index 66c2150..9170824 100644 --- a/core/lib/Drupal/Core/ExtensionHandler.php +++ b/core/lib/Drupal/Core/ExtensionHandler.php @@ -373,9 +373,9 @@ public function alter($type, &$data, &$context1 = NULL, &$context2 = NULL) { $cid = $type; } - // Some alter hooks are invoked many times per page request, so statically - // cache the list of functions to call, and on subsequent calls, iterate - // through them quickly. + // Some alter hooks are invoked many times per page request, so store the + // list of functions to call, and on subsequent calls, iterate through them + // quickly. if (!isset($this->alterFunctions[$cid])) { $this->alterFunctions[$cid] = array(); $hook = $type . '_alter'; @@ -404,7 +404,7 @@ public function alter($type, &$data, &$context1 = NULL, &$context2 = NULL) { // $this->alter('module_implements'). if (array_diff($extra_modules, $modules)) { // Merge the arrays and order by getEnabledModules(). - $modules = array_intersect($this->moduleList, array_merge($modules, $extra_modules)); + $modules = array_intersect(array_keys($this->moduleList), array_merge($modules, $extra_modules)); // Since $this->moduleImplements() already took care of loading the necessary // include files, we can safely pass FALSE for the array values. $implementations = array_fill_keys($modules, FALSE);