Commit 971a73c6 authored by alexpott's avatar alexpott

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

parent 73306d92
......@@ -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(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment