diff -u b/core/includes/common.inc b/core/includes/common.inc --- b/core/includes/common.inc +++ b/core/includes/common.inc @@ -268,8 +268,14 @@ function drupal_get_profile() { global $install_state; - if (isset($install_state['parameters']['profile'])) { - $profile = $install_state['parameters']['profile']; + if (defined('MAINTENANCE_MODE') && (MAINTENANCE_MODE == 'install')) { + // If the profile has been selected return it. + if (isset($install_state['parameters']['profile'])) { + $profile = $install_state['parameters']['profile']; + } + else { + $profile = ''; + } } else { $profile = Drupal::state()->get('profile.install') ?: 'standard'; only in patch2: unchanged: --- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php @@ -26,6 +26,11 @@ public static function getInfo() { * Tests that drupal_get_filename() works when the file is not in database. */ function testDrupalGetFilename() { + // drupal_get_profile() is using obtaining the profile from state if the + // install_state global is not set. + global $install_state; + $install_state['parameters']['profile'] = 'testing'; + // Assert that the test is meaningful by making sure the keyvalue service // does not exist. $this->assertFalse(drupal_container()->has('keyvalue'), 'The container has no keyvalue service.');