diff --git a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php index c8b30cea01..056ea333c9 100644 --- a/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php +++ b/core/lib/Drupal/Core/Config/Entity/DraggableListBuilder.php @@ -125,7 +125,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { foreach ($this->entities as $entity) { $row = $this->buildRow($entity); if (isset($row['label'])) { - $row['label'] = ['#markup' => $row['label']]; + $row['label'] = ['#plain_text' => $row['label']]; } if (isset($row['weight'])) { $row['weight']['#delta'] = $delta; diff --git a/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php b/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php index 1a3e463e68..117ad1a3b9 100644 --- a/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php +++ b/core/modules/config/tests/src/Functional/ConfigDraggableListBuilderTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\config\Functional; +use Drupal\Component\Utility\Html; use Drupal\Tests\BrowserTestBase; use Drupal\user\Entity\Role; @@ -49,6 +50,13 @@ public function testDraggableList() { for ($i = 0; $i < 51; $i++) { $this->assertSession()->pageTextContains("Role $i"); } + + $role = Role::load('role_0'); + $role_name = 'Role 0'; + $role->set('label', $role_name)->save(); + + $this->drupalGet('admin/people/roles'); + $this->assertSession()->responseContains('' . Html::escape($role_name)); } }