Commit 1a4fb654 authored by xjm's avatar xjm

Issue #2569419 by alexpott, lauriii, xjm: Replace remaining !placeholder in ConfigSync

parent c382eade
......@@ -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) {
......
......@@ -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>');
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment