diff --git a/core/includes/update.inc b/core/includes/update.inc index 41667b3..f711507 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -894,6 +894,7 @@ function update_variables_to_config($config_name, array $variable_map) { // This potentially loads an existing configuration object, in case another // update function migrated configuration values into $config_name already. $config = config($config_name); + $original_data = $config->get(); // Extract the module namespace/owner from the configuration object name. $module = strtok($config_name, '.'); @@ -903,7 +904,16 @@ function update_variables_to_config($config_name, array $variable_map) { // file, which is required to exist. $file = new FileStorage($config_name); $file->setPath(drupal_get_path('module', $module) . '/config'); - $data = $file->read(); + $default_data = $file->read(); + + // Merge any possibly existing original data into default values. + // Only relevant when being called repetitively on the same config object. + if (!empty($original_data)) { + $data = drupal_array_merge_deep($default_data, $original_data); + } + else { + $data = $default_data; + } // Apply the default values. $config->setData($data);