From 1a4fb65479a324cab548b7fac65375d9cd66766e Mon Sep 17 00:00:00 2001 From: xjm <xjm@65776.no-reply.drupal.org> Date: Fri, 18 Sep 2015 15:09:08 -0400 Subject: [PATCH] Issue #2569419 by alexpott, lauriii, xjm: Replace remaining !placeholder in ConfigSync --- core/modules/config/src/Form/ConfigSync.php | 18 +++++++++++------- .../src/Tests/ConfigExportImportUITest.php | 12 +++++++++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/core/modules/config/src/Form/ConfigSync.php b/core/modules/config/src/Form/ConfigSync.php index 19c12463f49a..e9b14cb4e87a 100644 --- a/core/modules/config/src/Form/ConfigSync.php +++ b/core/modules/config/src/Form/ConfigSync.php @@ -217,12 +217,16 @@ public function buildForm(array $form, FormStateInterface $form_state) { } } sort($change_list); - $change_list_render = array( - '#theme' => 'item_list', - '#items' => $change_list, - ); - $change_list_html = $this->renderer->renderPlain($change_list_render); - drupal_set_message($this->t('The following items in your active configuration have changes since the last import that may be lost on the next import. !changes', array('!changes' => $change_list_html)), 'warning'); + $message = [ + [ + '#markup' => $this->t('The following items in your active configuration have changes since the last import that may be lost on the next import.') + ], + [ + '#theme' => 'item_list', + '#items' => $change_list, + ] + ]; + drupal_set_message($this->renderer->renderPlain($message), 'warning'); } } @@ -237,7 +241,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form[$collection]['collection_heading'] = array( '#type' => 'html_tag', '#tag' => 'h2', - '#value' => $this->t('!collection configuration collection', array('!collection' => $collection)), + '#value' => $this->t('@collection configuration collection', array('@collection' => $collection)), ); } foreach ($storage_comparer->getChangelist(NULL, $collection) as $config_change_type => $config_names) { diff --git a/core/modules/config/src/Tests/ConfigExportImportUITest.php b/core/modules/config/src/Tests/ConfigExportImportUITest.php index e913e0d1d9c3..41183877ff1e 100644 --- a/core/modules/config/src/Tests/ConfigExportImportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportImportUITest.php @@ -187,13 +187,16 @@ public function testExportImport() { ->save(); $this->drupalGet('admin/config/development/configuration'); $this->assertText(t('Warning message')); - $this->assertText('The following items in your active configuration have changes since the last import that may be lost on the next import. system.site'); + $this->assertText('The following items in your active configuration have changes since the last import that may be lost on the next import.'); + // Ensure the item is displayed as part of a list (to avoid false matches + // on the rest of the page) and that the list markup is not escaped. + $this->assertRaw('<li>system.site</li>'); // Remove everything from staging. The warning about differences between the // active and snapshot should no longer exist. \Drupal::service('config.storage.staging')->deleteAll(); $this->drupalGet('admin/config/development/configuration'); $this->assertNoText(t('Warning message')); - $this->assertNoText('The following items in your active configuration have changes since the last import that may be lost on the next import. system.site'); + $this->assertNoText('The following items in your active configuration have changes since the last import that may be lost on the next import.'); $this->assertText(t('There are no configuration changes to import.')); // Write a file to staging. The warning about differences between the // active and snapshot should now exist. @@ -205,7 +208,10 @@ public function testExportImport() { $staging->write('system.site', $data); $this->drupalGet('admin/config/development/configuration'); $this->assertText(t('Warning message')); - $this->assertText('The following items in your active configuration have changes since the last import that may be lost on the next import. system.site'); + $this->assertText('The following items in your active configuration have changes since the last import that may be lost on the next import.'); + // Ensure the item is displayed as part of a list (to avoid false matches + // on the rest of the page) and that the list markup is not escaped. + $this->assertRaw('<li>system.site</li>'); } /** -- GitLab