diff --git a/core/modules/comment/src/CommentViewsData.php b/core/modules/comment/src/CommentViewsData.php index 55c3f4a1b9..132130ecf7 100644 --- a/core/modules/comment/src/CommentViewsData.php +++ b/core/modules/comment/src/CommentViewsData.php @@ -177,6 +177,7 @@ public function getViewsData() { 'help' => $this->t('Add a form element that lets you run operations on multiple comments.'), 'field' => [ 'id' => 'bulk_form', + 'empty_selected_message' => $this->t('Select one or more comments to perform the update on.'), ], ]; diff --git a/core/modules/comment/src/Plugin/views/field/CommentBulkForm.php b/core/modules/comment/src/Plugin/views/field/CommentBulkForm.php index e1b140879b..ae796857bb 100644 --- a/core/modules/comment/src/Plugin/views/field/CommentBulkForm.php +++ b/core/modules/comment/src/Plugin/views/field/CommentBulkForm.php @@ -13,7 +13,7 @@ * * @ViewsField("comment_bulk_form") * - * @deprecated in Drupal 8.9.x, will be removed before Drupal 9.0.0. Use + * @deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use * \Drupal\views\Plugin\views\field\BulkForm instead. * * @see https://www.drupal.org/node/2956578 @@ -24,7 +24,7 @@ class CommentBulkForm extends BulkForm { * {@inheritdoc} */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager, MessengerInterface $messenger, EntityRepositoryInterface $entity_repository = NULL) { - @trigger_error('CommentBulkForm is deprecated in Drupal 8.9.x, will be removed before Drupal 9.0.0. Use \Drupal\views\Plugin\views\field\BulkForm instead. See https://www.drupal.org/node/2956578.', E_USER_DEPRECATED); + @trigger_error(__CLASS__ . ' is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use \Drupal\views\Plugin\views\field\BulkForm instead. See https://www.drupal.org/node/2956578', E_USER_DEPRECATED); parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $language_manager, $messenger, $entity_repository); } diff --git a/core/modules/node/src/NodeViewsData.php b/core/modules/node/src/NodeViewsData.php index c714631d5d..24cf97a10b 100644 --- a/core/modules/node/src/NodeViewsData.php +++ b/core/modules/node/src/NodeViewsData.php @@ -63,6 +63,7 @@ public function getViewsData() { 'help' => $this->t('Add a form element that lets you run operations on multiple nodes.'), 'field' => [ 'id' => 'bulk_form', + 'empty_selected_message' => $this->t('No content selected.'), ], ]; diff --git a/core/modules/node/src/Plugin/views/field/NodeBulkForm.php b/core/modules/node/src/Plugin/views/field/NodeBulkForm.php index b49f5ef766..c8ea293c8b 100644 --- a/core/modules/node/src/Plugin/views/field/NodeBulkForm.php +++ b/core/modules/node/src/Plugin/views/field/NodeBulkForm.php @@ -13,7 +13,7 @@ * * @ViewsField("node_bulk_form") * - * @deprecated in Drupal 8.9.x, will be removed before Drupal 9.0.0. Use + * @deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use * \Drupal\views\Plugin\views\field\BulkForm instead. * * @see https://www.drupal.org/node/2956578 @@ -24,7 +24,7 @@ class NodeBulkForm extends BulkForm { * {@inheritdoc} */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager, MessengerInterface $messenger, EntityRepositoryInterface $entity_repository = NULL) { - @trigger_error('NodeBulkForm is deprecated in Drupal 8.9.x, will be removed before Drupal 9.0.0. Use \Drupal\views\Plugin\views\field\BulkForm instead. See https://www.drupal.org/node/2956578.', E_USER_DEPRECATED); + @trigger_error(__CLASS__ . ' is deprecated in drupal:9.0.0 and is removed before drupal:10.0.0. Use \Drupal\views\Plugin\views\field\BulkForm instead. See https://www.drupal.org/node/2956578', E_USER_DEPRECATED); parent::__construct($configuration, $plugin_id, $plugin_definition, $entity_type_manager, $language_manager, $messenger, $entity_repository); } diff --git a/core/modules/user/src/UserViewsData.php b/core/modules/user/src/UserViewsData.php index 955ab5967b..009fa98521 100644 --- a/core/modules/user/src/UserViewsData.php +++ b/core/modules/user/src/UserViewsData.php @@ -217,6 +217,7 @@ public function getViewsData() { 'help' => $this->t('Add a form element that lets you run operations on multiple users.'), 'field' => [ 'id' => 'user_bulk_form', + 'empty_selected_message' => $this->t('No users selected.'), ], ]; diff --git a/core/modules/views/src/Entity/View.php b/core/modules/views/src/Entity/View.php index e246aff0cc..491447bb6d 100644 --- a/core/modules/views/src/Entity/View.php +++ b/core/modules/views/src/Entity/View.php @@ -299,9 +299,6 @@ public function preSave(EntityStorageInterface $storage) { // @see https://www.drupal.org/project/drupal/issues/3069405 . $this->fixTableNames($displays); - // @todo Remove this line in Drupal 9. - $this->fixEmptySelectedMessage($displays); - // Sort the displays. ksort($displays); $this->set('display', ['default' => $displays['default']] + $displays); @@ -356,38 +353,6 @@ private function fixTableNames(array &$displays) { } } - /** - * Fixes empty selected message for bulk operation fields. - * - * @param array &$displays - * An array containing display handlers of a view. - * - * @todo Remove this method and its usage in Drupal 9. - * - * @see https://www.drupal.org/project/drupal/issues/2909423 - */ - private function fixEmptySelectedMessage(array &$displays) { - foreach ($displays as $display_name => &$display) { - if (isset($display['display_options']['fields'])) { - foreach ($display['display_options']['fields'] as $field_name => &$field) { - // Convert to using bulk_form plugin and set empty selected_message. - if (isset($field['plugin_id']) && $field['plugin_id'] === 'comment_bulk_form') { - $display['display_options']['fields'][$field_name]['plugin_id'] = 'bulk_form'; - $display['display_options']['fields'][$field_name]['empty_selected_message'] = 'Select one or more comments to perform the update on.'; - } - elseif (isset($field['plugin_id']) && $field['plugin_id'] === 'node_bulk_form') { - $display['display_options']['fields'][$field_name]['plugin_id'] = 'bulk_form'; - $display['display_options']['fields'][$field_name]['empty_selected_message'] = 'No content selected.'; - } - elseif (isset($field['plugin_id']) && $field['plugin_id'] === 'user_bulk_form') { - $display['display_options']['fields'][$field_name]['plugin_id'] = 'bulk_form'; - $display['display_options']['fields'][$field_name]['empty_selected_message'] = 'No users selected.'; - } - } - } - } - } - /** * Fills in the cache metadata of this view. *