From 27c80649f1fd619f030646fec65d1b65fb5911f1 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 20 Mar 2018 23:00:39 +0000
Subject: [PATCH] Issue #2942588 by mohit1604, chr.fritsch, tstoeckler, bojanz,
 joshi.rohit100, hchonov: EntityListBuilder::render() should use the entity
 type plural label in the empty text

---
 core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php | 2 +-
 core/lib/Drupal/Core/Entity/EntityListBuilder.php           | 2 +-
 core/modules/action/tests/src/Functional/ActionListTest.php | 2 +-
 .../tests/src/Functional/BlockContentListTest.php           | 2 +-
 .../config/tests/src/Functional/ConfigEntityListTest.php    | 2 +-
 .../tests/src/Functional/ResponsiveImageAdminUITest.php     | 6 +++---
 .../workflows/tests/src/Functional/WorkflowUiNoTypeTest.php | 2 +-
 .../workflows/tests/src/Functional/WorkflowUiTest.php       | 4 ++--
 8 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
index f6bf463b1631..d70aee86af39 100644
--- a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
+++ b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php
@@ -107,7 +107,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
     $form[$this->entitiesKey] = [
       '#type' => 'table',
       '#header' => $this->buildHeader(),
-      '#empty' => t('There is no @label yet.', ['@label' => $this->entityType->getLabel()]),
+      '#empty' => t('There are no @label yet.', ['@label' => $this->entityType->getPluralLabel()]),
       '#tabledrag' => [
         [
           'action' => 'order',
diff --git a/core/lib/Drupal/Core/Entity/EntityListBuilder.php b/core/lib/Drupal/Core/Entity/EntityListBuilder.php
index 7191fae8d407..91f4d2129704 100644
--- a/core/lib/Drupal/Core/Entity/EntityListBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityListBuilder.php
@@ -223,7 +223,7 @@ public function render() {
       '#header' => $this->buildHeader(),
       '#title' => $this->getTitle(),
       '#rows' => [],
-      '#empty' => $this->t('There is no @label yet.', ['@label' => $this->entityType->getLabel()]),
+      '#empty' => $this->t('There are no @label yet.', ['@label' => $this->entityType->getPluralLabel()]),
       '#cache' => [
         'contexts' => $this->entityType->getListCacheContexts(),
         'tags' => $this->entityType->getListCacheTags(),
diff --git a/core/modules/action/tests/src/Functional/ActionListTest.php b/core/modules/action/tests/src/Functional/ActionListTest.php
index 309160f4be9c..fc67986e7767 100644
--- a/core/modules/action/tests/src/Functional/ActionListTest.php
+++ b/core/modules/action/tests/src/Functional/ActionListTest.php
@@ -31,7 +31,7 @@ public function testEmptyActionList() {
     $actions  = $storage->loadMultiple();
     $storage->delete($actions);
     $this->drupalGet('/admin/config/system/actions');
-    $this->assertRaw('There is no Action yet.');
+    $this->assertRaw('There are no actions yet.');
   }
 
 }
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentListTest.php b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
index aba60c366c62..9a26f1c40776 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentListTest.php
@@ -103,7 +103,7 @@ public function testListing() {
     $this->assertNoFieldByXpath('//td', $new_label, 'No label found for deleted custom block.');
 
     // Confirm that the empty text is displayed.
-    $this->assertText(t('There is no Custom block yet.'));
+    $this->assertText(t('There are no custom blocks yet.'));
   }
 
 }
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
index ae9be133f601..b92629d1977d 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityListTest.php
@@ -243,7 +243,7 @@ public function testListUI() {
     $this->assertNoFieldByXpath('//td', 'dotted.default', "No machine name found for deleted 'Default' entity.");
 
     // Confirm that the empty text is displayed.
-    $this->assertText('There is no Test configuration yet.');
+    $this->assertText('There are no test configuration entities yet.');
   }
 
   /**
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
index eeaf793fa088..ce9050e2736d 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
@@ -35,7 +35,7 @@ protected function setUp() {
   public function testResponsiveImageAdmin() {
     // We start without any default styles.
     $this->drupalGet('admin/config/media/responsive-image-style');
-    $this->assertText('There is no Responsive image style yet.');
+    $this->assertText('There are no responsive image styles yet.');
 
     // Add a responsive image style.
     $this->drupalGet('admin/config/media/responsive-image-style/add');
@@ -54,7 +54,7 @@ public function testResponsiveImageAdmin() {
     // Check if the new group is created.
     $this->assertResponse(200);
     $this->drupalGet('admin/config/media/responsive-image-style');
-    $this->assertNoText('There is no Responsive image style yet.');
+    $this->assertNoText('There are no responsive image styles yet.');
     $this->assertText('Style One');
     $this->assertText('style_one');
 
@@ -137,7 +137,7 @@ public function testResponsiveImageAdmin() {
     $this->drupalGet('admin/config/media/responsive-image-style/style_one/delete');
     $this->drupalPostForm(NULL, [], t('Delete'));
     $this->drupalGet('admin/config/media/responsive-image-style');
-    $this->assertText('There is no Responsive image style yet.');
+    $this->assertText('There are no responsive image styles yet.');
   }
 
 }
diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php
index 197386ebd0d9..01c61ac6b00d 100644
--- a/core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php
+++ b/core/modules/workflows/tests/src/Functional/WorkflowUiNoTypeTest.php
@@ -49,7 +49,7 @@ public function testWorkflowUiWithNoType() {
     $this->drupalGet('admin/config/workflow/workflows');
     $this->assertSession()->pageTextNotContains('There are no workflow types available. In order to create workflows you need to install a module that provides a workflow type. For example, the Content Moderation module provides a workflow type that enables workflows for content entities.');
     $this->assertSession()->linkExists('Add workflow');
-    $this->assertSession()->pageTextContains('There is no Workflow yet.');
+    $this->assertSession()->pageTextContains('There are no workflows yet.');
   }
 
 }
diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
index b15b24099c18..d3492201ddce 100644
--- a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
+++ b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
@@ -109,7 +109,7 @@ public function testWorkflowCreation() {
     $this->assertSession()->linkByHrefExists('admin/config/workflow/workflows');
     $this->clickLink('Workflows');
     $this->assertSession()->pageTextContains('Workflows');
-    $this->assertSession()->pageTextContains('There is no Workflow yet.');
+    $this->assertSession()->pageTextContains('There are no workflows yet.');
     $this->clickLink('Add workflow');
     $this->submitForm(['label' => 'Test', 'id' => 'test', 'workflow_type' => 'workflow_type_test'], 'Save');
     $this->assertSession()->pageTextContains('Created the Test Workflow.');
@@ -253,7 +253,7 @@ public function testWorkflowCreation() {
     $this->assertSession()->pageTextContains('Are you sure you want to delete Test?');
     $this->submitForm([], 'Delete');
     $this->assertSession()->pageTextContains('Workflow Test deleted.');
-    $this->assertSession()->pageTextContains('There is no Workflow yet.');
+    $this->assertSession()->pageTextContains('There are no workflows yet.');
     $this->assertNull($workflow_storage->loadUnchanged('test'), 'The test workflow has been deleted');
 
     // Ensure that workflow types with default configuration are initialized
-- 
GitLab