diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 6b08dd9..170d532 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -744,17 +744,19 @@ function drupal_get_profile() { $profile = NULL; } } - elseif (\Drupal::hasContainer()) { - $profile = \Drupal::installProfile(); - } - // Try to load the value directly from configuration. - if (empty($profile)) { - $profile = BootstrapConfigStorageFactory::getDatabaseStorage()->read('core.extension')['profile']; - } - // A BC layer just in in case this only exists in Settings. Introduced in - // Drupal 8.3.x and will be removed before Drupal 9.0.0. - if (empty($profile)) { - $profile = Settings::get('install_profile'); + else { + if (\Drupal::hasContainer()) { + $profile = \Drupal::installProfile(); + } + else { + $profile = BootstrapConfigStorageFactory::getDatabaseStorage()->read('core.extension')['profile']; + } + + // A BC layer just in in case this only exists in Settings. Introduced in + // Drupal 8.3.x and will be removed before Drupal 9.0.0. + if (empty($profile)) { + $profile = Settings::get('install_profile'); + } } return $profile;