diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc index e77d22c..d636032 100644 --- a/core/modules/comment/comment.views.inc +++ b/core/modules/comment/comment.views.inc @@ -247,6 +247,14 @@ function comment_views_data() { ), ); + $data['comment']['comment_bulk_form'] = array( + 'title' => t('Comment operations bulk form'), + 'help' => t('Add a form element that lets you run operations on multiple comments.'), + 'field' => array( + 'id' => 'comment_bulk_form', + ), + ); + $data['comment']['view_comment'] = array( 'field' => array( 'title' => t('Link to comment'), diff --git a/core/modules/comment/config/views.view.comments.yml b/core/modules/comment/config/views.view.comments.yml index c5c57cd..f809c93 100644 --- a/core/modules/comment/config/views.view.comments.yml +++ b/core/modules/comment/config/views.view.comments.yml @@ -64,14 +64,14 @@ display: groups: 1: AND fields: - action_bulk_form: - id: action_bulk_form - table: action - field: action_bulk_form + comment_bulk_form: + id: comment_bulk_form + table: comment + field: comment_bulk_form relationship: none group_type: group admin_label: '' - label: 'Bulk update' + label: '' exclude: '0' alter: alter_text: '0' @@ -104,7 +104,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: '1' + element_label_colon: '0' element_wrapper_type: '' element_wrapper_class: '' element_default_classes: '1' @@ -112,11 +112,8 @@ display: hide_empty: '0' empty_zero: '0' hide_alter_empty: '1' - include_exclude: include - selected_actions: - comment_delete_action: comment_delete_action - comment_unpublish_action: comment_unpublish_action - plugin_id: action_bulk_form + plugin_id: comment_bulk_form + provider: comment subject: id: subject table: comment @@ -473,7 +470,6 @@ display: fields: edit_comment: edit_comment delete_comment: delete_comment - action_bulk_form: '0' subject: '0' name: '0' title: '0' @@ -540,14 +536,14 @@ display: groups: 1: AND fields: - action_bulk_form: - id: action_bulk_form - table: action - field: action_bulk_form + comment_bulk_form: + id: comment_bulk_form + table: comment + field: comment_bulk_form relationship: none group_type: group admin_label: '' - label: 'Bulk update' + label: '' exclude: '0' alter: alter_text: '0' @@ -580,7 +576,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: '1' + element_label_colon: '0' element_wrapper_type: '' element_wrapper_class: '' element_default_classes: '1' @@ -588,11 +584,8 @@ display: hide_empty: '0' empty_zero: '0' hide_alter_empty: '1' - include_exclude: include - selected_actions: - comment_delete_action: comment_delete_action - comment_publish_action: comment_publish_action - plugin_id: action_bulk_form + plugin_id: comment_bulk_form + provider: comment subject: id: subject table: comment @@ -1001,7 +994,6 @@ display: approve_comment: approve_comment edit_comment: edit_comment delete_comment: delete_comment - action_bulk_form: '0' subject: '0' name: '0' title: '0' @@ -1073,22 +1065,19 @@ display: summary: '' description: '' columns: - action_bulk_form: action_bulk_form + comment_bulk_form: comment_bulk_form subject: subject name: name title: title changed: changed - approve_comment: approve_comment edit_comment: edit_comment delete_comment: delete_comment dropbutton: dropbutton info: - action_bulk_form: - sortable: '0' - default_sort_order: asc + comment_bulk_form: align: '' separator: '' - empty_column: '1' + empty_column: '0' responsive: '' subject: sortable: '1' @@ -1118,13 +1107,6 @@ display: separator: '' empty_column: '0' responsive: '' - approve_comment: - sortable: '0' - default_sort_order: asc - align: '' - separator: '' - empty_column: '0' - responsive: '' edit_comment: sortable: '0' default_sort_order: asc @@ -1160,58 +1142,6 @@ display: group_type: group admin_label: Content fields: - action_bulk_form: - id: action_bulk_form - table: action - field: action_bulk_form - relationship: none - group_type: group - admin_label: '' - label: 'Bulk update' - exclude: '0' - alter: - alter_text: '0' - text: '' - make_link: '0' - path: '' - absolute: '0' - external: '0' - replace_spaces: '0' - path_case: none - trim_whitespace: '0' - alt: '' - rel: '' - link_class: '' - prefix: '' - suffix: '' - target: '' - nl2br: '0' - max_length: '' - word_boundary: '1' - ellipsis: '1' - more_link: '0' - more_link_text: '' - more_link_path: '' - strip_tags: '0' - trim: '0' - preserve_tags: '' - html: '0' - element_type: '' - element_class: '' - element_label_type: '' - element_label_class: '' - element_label_colon: '1' - element_wrapper_type: '' - element_wrapper_class: '' - element_default_classes: '1' - empty: '' - hide_empty: '0' - empty_zero: '0' - hide_alter_empty: '1' - include_exclude: include - selected_actions: - comment_unpublish_action: comment_unpublish_action - plugin_id: action_bulk_form subject: id: subject table: comment 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 832aa30..63f194d 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Action/DeleteComment.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Action/DeleteComment.php @@ -11,6 +11,7 @@ use Drupal\Core\Annotation\Translation; use Drupal\Core\Action\ActionBase; use Drupal\Core\Cache\Cache; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\user\TempStoreFactory; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -24,7 +25,7 @@ * confirm_form_path = "admin/content/comment/delete" * ) */ -class DeleteComment extends ActionBase { +class DeleteComment extends ActionBase implements ContainerFactoryPluginInterface { /** * The tempstore object.