diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 721d106..4a32bf8 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -797,27 +797,28 @@ function install_tasks($install_state) { ], ]; + if (!empty($install_state['config_install'])) { + // @todo add a load of commentary about what is happening. + unset($tasks['install_download_translation']); + $key = array_search('install_profile_modules', array_keys($tasks), TRUE); + unset($tasks['install_profile_modules']); + unset($tasks['install_profile_themes']); + unset($tasks['install_install_profile']); + $config_tasks = [ + 'install_config_import_batch' => [ + 'display_name' => t('Install configuration'), + 'type' => 'batch', + ], + 'install_config_download_translations' => [], + 'install_config_fix_profile' => [], + ]; + $tasks = array_slice($tasks, 0, $key, TRUE) + + $config_tasks + + array_slice($tasks, $key, NULL, TRUE); + } + // Now add any tasks defined by the installation profile. if (!empty($install_state['parameters']['profile'])) { - if ($install_state['config_install']) { - // @todo add a load of commentary about what is happening. - unset($tasks['install_download_translation']); - $key = array_search('install_profile_modules', array_keys($tasks), TRUE); - unset($tasks['install_profile_modules']); - unset($tasks['install_profile_themes']); - unset($tasks['install_install_profile']); - $config_tasks = [ - 'install_config_import_batch' => [ - 'display_name' => t('Install configuration'), - 'type' => 'batch', - ], - 'install_config_download_translations' => [], - 'install_config_fix_profile' => [], - ]; - $tasks = array_slice($tasks, 0, $key, TRUE) + - $config_tasks + - array_slice($tasks, $key, NULL, TRUE); - } // Load the profile install file, because it is not always loaded when // hook_install_tasks() is invoked (e.g. batch processing). $profile = $install_state['parameters']['profile']; @@ -1495,7 +1496,7 @@ function install_load_profile(&$install_state) { $install_state['profile_info'] = install_profile_info($profile, isset($install_state['parameters']['langcode']) ? $install_state['parameters']['langcode'] : 'en'); // If the profile has a config/sync directory copy the information to the // install_state global. - if (isset($install_state['profile_info']['config_install'])) { + if (!empty($install_state['profile_info']['config_install'])) { $install_state['config_install'] = $install_state['profile_info']['config_install']; $install_state['config'] = $install_state['profile_info']['config']; } diff --git a/core/includes/install.inc b/core/includes/install.inc index 672815c..fb1dfd7 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -485,15 +485,17 @@ function _drupal_rewrite_settings_dump_one(\stdClass $variable, $prefix = '', $s function drupal_install_config_directories() { global $config_directories, $install_state; - // Add a randomized config directory name to settings.php, unless it was - // manually defined in the existing already. + // If settings.php does not contain a config sync directory name we need to + // configure one. if (empty($config_directories[CONFIG_SYNC_DIRECTORY])) { - if ($install_state['config_install']) { - $profile = $install_state['parameters']['profile']; - $config_directories[CONFIG_SYNC_DIRECTORY] = $install_state['config_install']; + if (empty($install_state['config_install'])) { + // Add a randomized config directory name to settings.php + $config_directories[CONFIG_SYNC_DIRECTORY] = \Drupal::service('site.path') . '/files/config_' . Crypt::randomBytesBase64(55) . '/sync'; } else { - $config_directories[CONFIG_SYNC_DIRECTORY] = \Drupal::service('site.path') . '/files/config_' . Crypt::randomBytesBase64(55) . '/sync'; + // Install profiles can contain a config sync directory. If they do, + // 'config_install' is a path to the directory. + $config_directories[CONFIG_SYNC_DIRECTORY] = $install_state['config_install']; } $settings['config_directories'][CONFIG_SYNC_DIRECTORY] = (object) [ 'value' => $config_directories[CONFIG_SYNC_DIRECTORY], @@ -1084,7 +1086,7 @@ function install_profile_info($profile, $langcode = 'en') { 'version' => NULL, 'hidden' => FALSE, 'php' => DRUPAL_MINIMUM_PHP, - 'config_install' => FALSE, + 'config_install' => NULL, ]; $profile_path = drupal_get_path('profile', $profile); $info = \Drupal::service('info_parser')->parse($profile_path . "/$profile.info.yml");