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 @@ -158,10 +158,15 @@ // 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']); + } $profile_list[$profile] = $profile; $info['profile_list'] = $profile_list; 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 @@ -1044,15 +1044,17 @@ } // This must be done after _system_rebuild_module_data_ensure_required(). - $profile = drupal_get_profile(); - if ($profile && isset($modules[$profile])) { - // The installation profile is required, if it's a valid module. - $modules[$profile]->info['required'] = TRUE; - // Add a default distribution name if the profile did not provide one. - // @see install_profile_info() - // @see drupal_install_profile_distribution_name() - if (!isset($modules[$profile]->info['distribution']['name'])) { - $modules[$profile]->info['distribution']['name'] = 'Drupal'; + $profiles = \Drupal::service('profile_handler')->getProfiles(); + foreach ($profiles as $profile_name => $profile) { + if (isset($modules[$profile_name])) { + // Installation profiles are required, if it's a valid module. + $modules[$profile_name]->info['required'] = TRUE; + // Add a default distribution name if the profile did not provide one. + // @see install_profile_info() + // @see drupal_install_profile_distribution_name() + if (!isset($modules[$profile_name]->info['distribution']['name'])) { + $modules[$profile_name]->info['distribution']['name'] = 'Drupal'; + } } }