1 system.install system_update_1078()

Re-arrange flexible layout configuration so we can save region classes.

Related topics

File

core/modules/system/system.install, line 3348
Install, update and uninstall functions for the system module.

Code

function system_update_1078() {
  $flexible_layouts = config_get_names_with_prefix('layout.flexible.');
  foreach ($flexible_layouts as $layout_name) {
    $config = config($layout_name);
    $rows = $config->get('rows');
    foreach ($rows as $row_key => $row) {
      foreach ($row['region_names'] as $region_key => $region_name) {
        $number = str_replace('region_name_', '', $region_key);
        $config->set('rows.' . $row_key . '.region_names.region_' . $number . '.label', $region_name);
        $config->set('rows.' . $row_key . '.region_names.region_' . $number . '.name', backdrop_html_class($region_name));
        $config->clear('rows.' . $row_key . '.region_names.' . $region_key);
      }
    }
    $config->save();
  }
}