diff --git a/core/modules/action/src/Tests/BulkFormTest.php b/core/modules/action/src/Tests/BulkFormTest.php
index 88892c4..585170f 100644
--- a/core/modules/action/src/Tests/BulkFormTest.php
+++ b/core/modules/action/src/Tests/BulkFormTest.php
@@ -140,13 +140,22 @@ public function testBulkForm() {
     $result = $this->xpath('//label[@for="edit-action"]');
     $this->assertEqual('Test title', (string) $result[0]);
 
+    // Test action without permissions.
+    $this->drupalLogin($this->createUser());
     $this->drupalGet('test_bulk_form');
-    // Call the node delete action.
     $edit = array();
     for ($i = 0; $i < 5; $i++) {
       $edit["node_bulk_form[$i]"] = TRUE;
     }
-    $edit += array('action' => 'node_delete_action');
+    $edit += array('action' => 'node_save_action');
+    $this->drupalPostForm(NULL, $edit, t('Apply'));
+    $this->assertText(t('No access to execute Save content on the Content'));
+    $this->assertNoText(t('Save content was applied to 5 items.'));
+
+    // Call the node delete action.
+    $this->drupalLogin($admin_user);
+    $this->drupalGet('test_bulk_form');
+    $edit['action'] = 'node_delete_action';
     $this->drupalPostForm(NULL, $edit, t('Apply'));
     // Make sure we don't show an action message while we are still on the
     // confirmation page.
diff --git a/core/modules/system/src/Plugin/views/field/BulkForm.php b/core/modules/system/src/Plugin/views/field/BulkForm.php
index 9d62e84..f37cb82 100644
--- a/core/modules/system/src/Plugin/views/field/BulkForm.php
+++ b/core/modules/system/src/Plugin/views/field/BulkForm.php
@@ -385,7 +385,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(),
