You are here

function views_post_update_sort_identifier in Drupal 9

Add the identifier option to all sort handler configurations.

File

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

Code

function views_post_update_sort_identifier(?array &$sandbox = NULL) : void {

  /** @var \Drupal\views\ViewsConfigUpdater $view_config_updater */
  $view_config_updater = \Drupal::classResolver(ViewsConfigUpdater::class);
  \Drupal::classResolver(ConfigEntityUpdater::class)
    ->update($sandbox, 'view', function (ViewEntityInterface $view) use ($view_config_updater) : bool {
    return $view_config_updater
      ->needsSortFieldIdentifierUpdate($view);
  });
}