diff --git a/core/modules/comment/config/system.action.comment_delete_action.yml b/core/modules/comment/config/install/system.action.comment_delete_action.yml similarity index 76% rename from core/modules/comment/config/system.action.comment_delete_action.yml rename to core/modules/comment/config/install/system.action.comment_delete_action.yml index 90f85f2..5034172 100644 --- a/core/modules/comment/config/system.action.comment_delete_action.yml +++ b/core/modules/comment/config/install/system.action.comment_delete_action.yml @@ -1,6 +1,5 @@ id: comment_delete_action label: 'Delete comment' -uuid: jibran95-m4d3-th15-uu1d-f0rc0mm3n752 status: true langcode: en type: comment diff --git a/core/modules/comment/config/views.view.comment.yml b/core/modules/comment/config/install/views.view.comment.yml similarity index 99% rename from core/modules/comment/config/views.view.comment.yml rename to core/modules/comment/config/install/views.view.comment.yml index e775839..b4a239f 100644 --- a/core/modules/comment/config/views.view.comment.yml +++ b/core/modules/comment/config/install/views.view.comment.yml @@ -1215,5 +1215,4 @@ label: Comment module: views id: comment tag: '' -uuid: 9a78bdd7-cf3c-46f3-8700-daae8243d7a7 langcode: en diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Action/DeleteComment.php b/core/modules/comment/lib/Drupal/comment/Plugin/Action/DeleteComment.php index 51c96c2..1f0bd48 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Action/DeleteComment.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Action/DeleteComment.php @@ -52,7 +52,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi /** * {@inheritdoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static($configuration, $plugin_id, $plugin_definition, $container->get('user.tempstore')); } @@ -66,8 +66,8 @@ public function executeMultiple(array $entities) { /** * {@inheritdoc} */ - public function execute($object = NULL) { - $this->executeMultiple(array($object)); + public function execute($entity = NULL) { + $this->executeMultiple(array($entity)); } } diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/CommentBulkForm.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/CommentBulkForm.php index 1d37b6f..584a569 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/CommentBulkForm.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/CommentBulkForm.php @@ -8,22 +8,23 @@ namespace Drupal\comment\Plugin\views\field; use Drupal\Component\Annotation\PluginID; -use Drupal\system\Plugin\views\field\BulkFormBase; +use Drupal\system\Plugin\views\field\BulkForm; use Drupal\Core\Cache\Cache; use Drupal\Core\Entity\EntityManager; +use Drupal\Core\Form\FormErrorInterface; /** * Defines a comment operations bulk form element. * * @PluginID("comment_bulk_form") */ -class CommentBulkForm extends BulkFormBase { +class CommentBulkForm extends BulkForm { /** * Constructs a new CommentBulkForm object. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityManager $manager) { - parent::__construct($configuration, $plugin_id, $plugin_definition, $manager); + public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityManager $manager, EntityStorageInterface $storage, FormErrorInterface $form_builder) { + parent::__construct($configuration, $plugin_id, $plugin_definition, $manager, $form_builder); // Filter the actions to only include those for the 'comment' entity type. $this->actions = array_filter($this->actions, function ($action) { @@ -115,7 +116,7 @@ protected function getBulkOptions($filtered = TRUE) { public function views_form_validate(&$form, &$form_state) { $selected = array_filter($form_state['values'][$this->options['id']]); if (empty($selected)) { - form_set_error('', t('No comments selected.')); + $this->formBuilder->setErrorByName('', $form_state, t('No comments selected.')); } } diff --git a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkForm.php b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkForm.php index 172162b..0503e54 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkForm.php +++ b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkForm.php @@ -7,6 +7,7 @@ namespace Drupal\system\Plugin\views\field; +use Drupal\Core\Form\FormErrorInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\field\FieldPluginBase; @@ -37,6 +38,13 @@ class BulkForm extends FieldPluginBase { protected $actions = array(); /** + * The form builder. + * + * @var \Drupal\Core\Form\FormErrorInterface + */ + protected $formBuilder; + + /** * Constructs a new BulkForm object. * * @param array $configuration @@ -47,18 +55,21 @@ class BulkForm extends FieldPluginBase { * The plugin implementation definition. * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The action storage. + * @param \Drupal\Core\Form\FormErrorInterface $form_builder + * The form builder. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $storage) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $storage, FormErrorInterface $form_builder) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->actionStorage = $storage; + $this->formBuilder = $form_builder; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity.manager')->getStorage('action')); + return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity.manager')->getStorage('action'), $container->get('form_builder')); } /** @@ -292,7 +303,7 @@ protected function emptySelectedMessage() { public function viewsFormValidate(&$form, &$form_state) { $selected = array_filter($form_state['values'][$this->options['id']]); if (empty($selected)) { - form_set_error('', $form_state, $this->emptySelectedMessage()); + $this->formBuilder->setErrorByName('', $form_state, $this->emptySelectedMessage()); } }