diff -u b/core/lib/Drupal/Core/Extension/ProfileHandler.php b/core/lib/Drupal/Core/Extension/ProfileHandler.php --- b/core/lib/Drupal/Core/Extension/ProfileHandler.php +++ b/core/lib/Drupal/Core/Extension/ProfileHandler.php @@ -151,15 +151,19 @@ // Ensure all dependencies are cleanly merged. $info['dependencies'] = array_merge($info['dependencies'], $base_info['dependencies']); - // Apply excluded dependencies. - $info['dependencies'] = array_diff($info['dependencies'], $info['base profile']['excluded_dependencies']); + if (isset($info['base profile']['excluded_dependencies'])) { + // Apply excluded dependencies. + $info['dependencies'] = array_diff($info['dependencies'], $info['base profile']['excluded_dependencies']); + } // Ensure there's no circular dependency. $info['dependencies'] = array_diff($info['dependencies'], [$profile]); // Ensure all themes are cleanly merged. $info['themes'] = array_unique(array_merge($info['themes'], $base_info['themes'])); - // Apply excluded themes. - $info['themes'] = array_diff($info['themes'], $info['base profile']['excluded_themes']); + if (isset($info['base profile']['excluded_themes'])) { + // Apply excluded themes. + $info['themes'] = array_diff($info['themes'], $info['base profile']['excluded_themes']); + } // Ensure each theme is listed only once. $info['themes'] = array_unique($info['themes']); } 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 @@ -950,13 +950,27 @@ function _system_rebuild_module_data() { $listing = new ExtensionDiscovery(\Drupal::root()); + // Find installation profiles. This needs to happen before performing a + // module scan as the module scan requires knowing what the active profile is. + // @todo Remove as part of https://www.drupal.org/node/2186491. + $profiles = $listing->scan('profile'); + $profile = drupal_get_profile(); + if ($profile && isset($profiles[$profile])) { + // Prime the drupal_get_filename() static cache with the profile info file + // location so we can use drupal_get_path() on the active profile during + // the module scan. + // @todo Remove as part of https://www.drupal.org/node/2186491. + drupal_get_filename('profile', $profile, $profiles[$profile]->getPathname()); + } + // Find modules. $modules = $listing->scan('module'); - - // Find profiles. - /** @var \Drupal\Core\Extension\ProfileHandlerInterface $profile_handler */ - $profile_handler = \Drupal::service('profile_handler'); - $modules = array_merge($modules, $profile_handler->getProfiles()); + // Include the installation profile in modules that are loaded. + if ($profile) { + $modules[$profile] = $profiles[$profile]; + // Installation profile hooks are always executed last. + $modules[$profile]->weight = 1000; + } // Set defaults for module info. $defaults = array( @@ -970,14 +984,7 @@ // Read info files for each module. foreach ($modules as $key => $module) { // Look for the info file. - // @todo On the longrun we should leverage the extension lists services, - // see https://www.drupal.org/node/2208429. - if ($module->getType() === 'profile') { - $module->info = $profile_handler->getProfileInfo($module->getName()); - } - else { - $module->info = \Drupal::service('info_parser')->parse($module->getPathname()); - } + $module->info = \Drupal::service('info_parser')->parse($module->getPathname()); // Add the info file modification time, so it becomes available for // contributed modules to use for ordering module lists. @@ -987,27 +994,13 @@ function _system_rebuild_module_data() { $listing = new ExtensionDiscovery(\Drupal::root()); - // Find installation profiles. This needs to happen before performing a - // module scan as the module scan requires knowing what the active profile is. - // @todo Remove as part of https://www.drupal.org/node/2186491. - $profiles = $listing->scan('profile'); - $profile = drupal_get_profile(); - if ($profile && isset($profiles[$profile])) { - // Prime the drupal_get_filename() static cache with the profile info file - // location so we can use drupal_get_path() on the active profile during - // the module scan. - // @todo Remove as part of https://www.drupal.org/node/2186491. - drupal_get_filename('profile', $profile, $profiles[$profile]->getPathname()); - } - // Find modules. $modules = $listing->scan('module'); - // Include the installation profile in modules that are loaded. - if ($profile) { - $modules[$profile] = $profiles[$profile]; - // Installation profile hooks are always executed last. - $modules[$profile]->weight = 1000; - } + + // Find profiles. + /** @var \Drupal\Core\Extension\ProfileHandlerInterface $profile_handler */ + $profile_handler = \Drupal::service('profile_handler'); + $modules = array_merge($modules, $profile_handler->getProfiles()); // Set defaults for module info. $defaults = array( @@ -1021,7 +1014,14 @@ // Read info files for each module. foreach ($modules as $key => $module) { // Look for the info file. - $module->info = \Drupal::service('info_parser')->parse($module->getPathname()); + // @todo On the longrun we should leverage the extension lists services, + // see https://www.drupal.org/node/2208429. + if ($module->getType() === 'profile') { + $module->info = $profile_handler->getProfileInfo($module->getName()); + } + else { + $module->info = \Drupal::service('info_parser')->parse($module->getPathname()); + } // Add the info file modification time, so it becomes available for // contributed modules to use for ordering module lists.