diff -u b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php --- b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php +++ b/core/lib/Drupal/Core/Config/ExtensionInstallStorage.php @@ -84,13 +84,22 @@ $this->folders += $this->getCoreNames(); $install_profile = Settings::get('install_profile'); + $profile = drupal_get_profile(); $extensions = $this->configStorage->read('core.extension'); - // @todo Remove as part of https://www.drupal.org/node/2186491 + // @todo Remove this scan as part of https://www.drupal.org/node/2186491 $listing = new ExtensionDiscovery(\Drupal::root()); if (!empty($extensions['module'])) { $modules = $extensions['module']; // Remove the install profile as this is handled later. unset($modules[$install_profile]); + $profile_list = $listing->scan('profile'); + if ($profile && isset($profile_list[$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, $profile_list[$profile]->getPathname()); + } $module_list_scan = $listing->scan('module'); $module_list = array(); foreach (array_keys($modules) as $module) { @@ -114,9 +123,10 @@ // The install profile can override module default configuration. We do // this by replacing the config file path from the module/theme with the // install profile version if there are any duplicates. - $profile = drupal_get_profile(); if (isset($profile)) { - $profile_list = $listing->scan('profile'); + if (!isset($profile_list)) { + $profile_list = $listing->scan('profile'); + } if (isset($profile_list[$profile])) { $profile_folders = $this->getComponentNames(array($profile_list[$profile])); $this->folders = $profile_folders + $this->folders;