Commit 66fa3fa9 authored by catch's avatar catch

Issue #2384853 by alexpott: Both configuration directories have to be specified in settings.php

parent cf00c8c1
......@@ -466,18 +466,22 @@ function drupal_install_config_directories() {
// Add a randomized config directory name to settings.php, unless it was
// manually defined in the existing already.
if (empty($config_directories)) {
$config_directories_hash = Crypt::randomBytesBase64(55);
$settings['config_directories'] = array(
CONFIG_ACTIVE_DIRECTORY => (object) array(
'value' => conf_path() . '/files/config_' . $config_directories_hash . '/active',
'required' => TRUE,
),
CONFIG_STAGING_DIRECTORY => (object) array(
'value' => conf_path() . '/files/config_' . $config_directories_hash . '/staging',
'required' => TRUE,
),
);
$settings = [];
$config_directories_hash = Crypt::randomBytesBase64(55);
if (empty($config_directories[CONFIG_ACTIVE_DIRECTORY])) {
$settings['config_directories'][CONFIG_ACTIVE_DIRECTORY] = (object) [
'value' => conf_path() . '/files/config_' . $config_directories_hash . '/active',
'required' => TRUE,
];
}
if (empty($config_directories[CONFIG_STAGING_DIRECTORY])) {
$settings['config_directories'][CONFIG_STAGING_DIRECTORY] = (object) [
'value' => conf_path() . '/files/config_' . $config_directories_hash . '/staging',
'required' => TRUE,
];
}
if (!empty($settings)) {
// Rewrite settings.php, which also sets the value as global variable.
drupal_rewrite_settings($settings);
}
......
......@@ -395,8 +395,9 @@ function system_requirements($phase) {
// defined, the installer will create a valid config directory later, but
// during runtime we must always display an error.
if (!empty($GLOBALS['config_directories'])) {
$directories[] = config_get_config_directory(CONFIG_ACTIVE_DIRECTORY);
$directories[] = config_get_config_directory(CONFIG_STAGING_DIRECTORY);
foreach ($GLOBALS['config_directories'] as $type => $directory) {
$directories[] = config_get_config_directory($type);
}
}
elseif ($phase != 'install') {
$requirements['config directories'] = array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment