diff -u b/core/modules/system/system.module b/core/modules/system/system.module --- b/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -870,6 +870,10 @@ $info[$module] = $data[$module]->info; } } + // Store the module info in cache. We rely on consecutive calls to + // system_rebuild_module_data() to reset this key, such as when + // listing modules, (un)installating modules, importing configuration, + // updating the site and when flushing all caches. \Drupal::cache()->set('system.module.info', $info); } return $info; @@ -1011,16 +1015,12 @@ $files[$name] = $module->getPathname(); } $modules = \Drupal::moduleHandler()->buildModuleDependencies($modules); - // Store the module info in cache. We rely on consecutive calls to - // system_rebuild_module_data() to reset this key, such as when - // listing modules, (un)installating modules, importing configuration, - // updating the site and when flushing all caches. $modules_cache = $modules; // Store filenames to allow drupal_get_filename() to // retrieve them without having to rebuild or scan the filesystem. \Drupal::state()->set('system.module.files', $files); - // Clear module info cache. + // Clear the module info cache. \Drupal::cache()->delete('system.module.info'); drupal_static_reset('system_get_info:module'); }