Skip to content
Snippets Groups Projects
Commit 7e9c8411 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2705823 by Lendude, Crell: BulkForm reports incorrect count

(cherry picked from commit 971a73c6)
parent ad2227bf
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,10 @@ public function testNodeEditAccess() {
'action' => 'node_unpublish_action',
);
$this->drupalPostForm('test-node-bulk-form', $edit, t('Apply to selected items'));
// Test that the action message isn't shown.
$this->assertNoRaw(SafeMarkup::format('%action was applied to 1 item.', [
'%action' => 'Unpublish content',
]));
// Re-load the node and check the status.
$node = Node::load($node->id());
$this->assertTrue($node->isPublished(), 'The node is still published.');
......
......@@ -380,7 +380,6 @@ public function viewsFormSubmit(&$form, FormStateInterface $form_state) {
else {
// Don't display the message unless there are some elements affected and
// there is no confirmation form.
$count = count(array_filter($form_state->getValue($this->options['id'])));
if ($count) {
drupal_set_message($this->formatPlural($count, '%action was applied to @count item.', '%action was applied to @count items.', array(
'%action' => $action->label(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment