You are here

function views_post_update_rename_default_display_setting in Drupal 9

Rename the setting for showing the default display to 'default_display'.

File

core/modules/views/views.post_update.php, line 59
Post update functions for Views.

Code

function views_post_update_rename_default_display_setting() {
  $config = \Drupal::configFactory()
    ->getEditable('views.settings');
  $config
    ->set('ui.show.default_display', $config
    ->get('ui.show.master_display'));
  $config
    ->clear('ui.show.master_display');
  $config
    ->save();
}