From 02ce89c4edfbdb6fb11cbb347b66b536b8ca0886 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Mon, 19 Jan 2015 08:55:01 +0000
Subject: [PATCH] Issue #2407907 by YesCT, mr.york: Configuration translation
 entity listings displays items overriden

---
 .../ConfigTranslationEntityListBuilder.php    |  4 ++--
 .../Tests/ConfigTranslationOverviewTest.php   | 23 +++++++++++++++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php b/core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php
index 9d94468e234b..a634fc19bf22 100644
--- a/core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php
+++ b/core/modules/config_translation/src/Controller/ConfigTranslationEntityListBuilder.php
@@ -8,12 +8,12 @@
 namespace Drupal\config_translation\Controller;
 
 use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Entity\EntityListBuilder;
+use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
 
 /**
  * Defines the configuration translation list builder for entities.
  */
-class ConfigTranslationEntityListBuilder extends EntityListBuilder implements ConfigTranslationEntityListBuilderInterface {
+class ConfigTranslationEntityListBuilder extends ConfigEntityListBuilder implements ConfigTranslationEntityListBuilderInterface {
 
   /**
    * Provides user facing strings for the filter element.
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php
index 2864317c4f30..22243af28c9e 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php
@@ -120,4 +120,27 @@ public function testHiddenEntities() {
     $this->assertLinkByHref('admin/config/regional/date-time/formats/manage/html_year/translate');
   }
 
+  /**
+   * Tests that overrides do not affect listing screens.
+   */
+  public function testListingPageWithOverrides() {
+    $original_label = 'Default';
+    $overridden_label = 'Overridden label';
+
+    // Set up an override.
+    $settings['config']['config_test.dynamic.dotted.default']['label'] = (object) array(
+      'value' => $overridden_label,
+      'required' => TRUE,
+    );
+    $this->writeSettings($settings);
+
+    // Test that the overridden label is loaded with the entity.
+    $this->assertEqual(config_test_load('dotted.default')->label(), $overridden_label);
+
+    // Test that the original label on the listing page is intact.
+    $this->drupalGet('admin/config/regional/config-translation/config_test');
+    $this->assertText($original_label);
+    $this->assertNoText($overridden_label);
+  }
+
 }
-- 
GitLab