diff --git a/core/modules/content_moderation/tests/modules/content_moderation_test_views/config/install/views.view.test_content_moderation_state_sort_base_table.yml b/core/modules/content_moderation/tests/modules/content_moderation_test_views/config/install/views.view.test_content_moderation_state_sort_base_table.yml index d87062da1c85a5e836e910339ecbf1a348fd03fb..16ba5ba97ac10f9a1330b8792835d641ce10d180 100644 --- a/core/modules/content_moderation/tests/modules/content_moderation_test_views/config/install/views.view.test_content_moderation_state_sort_base_table.yml +++ b/core/modules/content_moderation/tests/modules/content_moderation_test_views/config/install/views.view.test_content_moderation_state_sort_base_table.yml @@ -198,6 +198,7 @@ display: order: ASC expose: label: 'Moderation state' + field_identifier: moderation_state exposed: true arguments: { } filters: { } diff --git a/core/modules/content_moderation/tests/modules/content_moderation_test_views/config/install/views.view.test_content_moderation_state_sort_revision_table.yml b/core/modules/content_moderation/tests/modules/content_moderation_test_views/config/install/views.view.test_content_moderation_state_sort_revision_table.yml index 0e481bc59596df7604475a2075b6b49fb5d9276f..1e7e3b48ceaf948693f63d8841b71b8b844dcca6 100644 --- a/core/modules/content_moderation/tests/modules/content_moderation_test_views/config/install/views.view.test_content_moderation_state_sort_revision_table.yml +++ b/core/modules/content_moderation/tests/modules/content_moderation_test_views/config/install/views.view.test_content_moderation_state_sort_revision_table.yml @@ -197,6 +197,7 @@ display: order: ASC expose: label: 'Moderation state' + field_identifier: moderation_state exposed: true arguments: { } filters: { } diff --git a/core/modules/views/src/ViewsConfigUpdater.php b/core/modules/views/src/ViewsConfigUpdater.php index d79eb3753da40ace724e535645259b8f16e65d91..df6bc7ea99670a405f4dfe9b17623a2ccd5395a7 100644 --- a/core/modules/views/src/ViewsConfigUpdater.php +++ b/core/modules/views/src/ViewsConfigUpdater.php @@ -122,9 +122,6 @@ public function setDeprecationsEnabled($enabled) { public function updateAll(ViewEntityInterface $view) { return $this->processDisplayHandlers($view, FALSE, function (&$handler, $handler_type, $key, $display_id) use ($view) { $changed = FALSE; - if ($this->processSortFieldIdentifierUpdateHandler($handler, $handler_type)) { - $changed = TRUE; - } if ($this->processImageLazyLoadFieldHandler($handler, $handler_type, $view)) { $changed = TRUE; } @@ -173,21 +170,6 @@ protected function processDisplayHandlers(ViewEntityInterface $view, $return_on_ return $changed; } - /** - * Updates the sort handlers by adding default sort field identifiers. - * - * @param \Drupal\views\ViewEntityInterface $view - * The View to update. - * - * @return bool - * Whether the view was updated. - */ - public function needsSortFieldIdentifierUpdate(ViewEntityInterface $view): bool { - return $this->processDisplayHandlers($view, TRUE, function (array &$handler, string $handler_type): bool { - return $this->processSortFieldIdentifierUpdateHandler($handler, $handler_type); - }); - } - /** * Add lazy load options to all image type field configurations. * @@ -232,23 +214,4 @@ protected function processImageLazyLoadFieldHandler(array &$handler, string $han return $changed; } - /** - * Processes sort handlers by adding the sort identifier. - * - * @param array $handler - * A display handler. - * @param string $handler_type - * The handler type. - * - * @return bool - * Whether the handler was updated. - */ - protected function processSortFieldIdentifierUpdateHandler(array &$handler, string $handler_type): bool { - if ($handler_type === 'sort' && !isset($handler['expose']['field_identifier'])) { - $handler['expose']['field_identifier'] = $handler['id']; - return TRUE; - } - return FALSE; - } - } diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_sort_items_per_page.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_sort_items_per_page.yml index af946f8c1f7736cb404503ac3e8e67411c270887..ad9a6412519c81c866a51e373f99d0aa70d1a0d2 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_sort_items_per_page.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_exposed_form_sort_items_per_page.yml @@ -50,6 +50,7 @@ display: order: asc expose: label: 'id' + field_identifier: id exposed: true plugin_id: standard display_plugin: default