diff -u b/core/includes/module.inc b/core/includes/module.inc --- b/core/includes/module.inc +++ b/core/includes/module.inc @@ -133,14 +133,15 @@ } $key = $type . ':' . $module . ':' . $name; - if (!isset($files[$key])) { - if (function_exists('drupal_get_path')) { - $file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type"; - if (is_file($file)) { - require_once $file; - $files[$key] = $file; - return $file; - } + if (isset($files[$key])) { + return $files[$key]; + } + if (function_exists('drupal_get_path')) { + $file = DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "/$name.$type"; + if (is_file($file)) { + require_once $file; + $files[$key] = $file; + return $file; } } return FALSE; diff -u b/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php --- b/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -271,14 +271,15 @@ $name = $name ?: $module; $key = $type . ':' . $module . ':' . $name; - if (!isset($this->includeFileKeys[$key])) { - if (isset($this->moduleList[$module])) { - $file = $this->root . '/' . $this->moduleList[$module]->getPath() . "/$name.$type"; - if (is_file($file)) { - require_once $file; - $this->includeFileKeys[$key] = $file; - return $file; - } + if (isset($this->includeFileKeys[$key])) { + return $this->includeFileKeys[$key]; + } + if (isset($this->moduleList[$module])) { + $file = $this->root . '/' . $this->moduleList[$module]->getPath() . "/$name.$type"; + if (is_file($file)) { + require_once $file; + $this->includeFileKeys[$key] = $file; + return $file; } } return FALSE;