diff --git a/core/modules/forum/src/ForumUninstallValidator.php b/core/modules/forum/src/ForumUninstallValidator.php index 73a540c..9c6220d 100644 --- a/core/modules/forum/src/ForumUninstallValidator.php +++ b/core/modules/forum/src/ForumUninstallValidator.php @@ -76,9 +76,9 @@ public function validate($module) { $vocabulary = $this->getForumVocabulary(); if ($this->hasTermsForVocabulary($vocabulary)) { if ($vocabulary->access('view')) { - $reasons[] = $this->t('To uninstall Forum, first delete all %vocabulary terms', [ + $reasons[] = $this->t('To uninstall Forum, first delete all %vocabulary terms', [ '%vocabulary' => $vocabulary->label(), - '!url' => $vocabulary->url('overview-form'), + '@url' => $vocabulary->url('overview-form'), ]); } else { diff --git a/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php b/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php index d3028f3..85145c2 100644 --- a/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php +++ b/core/modules/forum/tests/src/Unit/ForumUninstallValidatorTest.php @@ -127,8 +127,8 @@ public function testValidateHasTermsForVocabularyWithNodesAccess() { $module = 'forum'; $expected = [ 'To uninstall Forum, first delete all Forum content', - SafeMarkup::format('To uninstall Forum, first delete all %vocabulary terms', [ - '!url' => '/path/to/vocabulary/overview', + SafeMarkup::format('To uninstall Forum, first delete all %vocabulary terms', [ + '@url' => '/path/to/vocabulary/overview', '%vocabulary' => 'Vocabulary label', ]), ]; @@ -200,8 +200,8 @@ public function testValidateHasTermsForVocabularyAccess() { $module = 'forum'; $expected = [ - SafeMarkup::format('To uninstall Forum, first delete all %vocabulary terms', [ - '!url' => '/path/to/vocabulary/overview', + SafeMarkup::format('To uninstall Forum, first delete all %vocabulary terms', [ + '@url' => '/path/to/vocabulary/overview', '%vocabulary' => 'Vocabulary label', ]), ]; diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index d7503ea..276e393 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -303,16 +303,22 @@ function theme_system_modules_uninstall($variables) { // Display table. $rows = array(); foreach (Element::children($form['modules']) as $module) { - $disabled_message = ''; + $disabled_header = ''; + $disabled_reasons = ''; // Add the modules requiring the module in question as a validation reason. if (!empty($form['modules'][$module]['#required_by'])) { $form['modules'][$module]['#validation_reasons'][] = \Drupal::translation()->translate('Required by: @modules', array('@modules' => implode(', ',$form['modules'][$module]['#required_by']))); } if (!empty($form['modules'][$module]['#validation_reasons'])) { - $disabled_message = \Drupal::translation()->formatPlural(count($form['modules'][$module]['#validation_reasons']), - 'The following reason prevents @module from being uninstalled: !reasons.', - 'The following reasons prevents @module from being uninstalled: !reasons.', - array('@module' => $form['modules'][$module]['#module_name'], '!reasons' => SafeMarkup::checkAdminXss(implode('; ', $form['modules'][$module]['#validation_reasons'])))); + $disabled_reasons = [ + '#theme' => 'item_list', + '#items' => $form['modules'][$module]['#validation_reasons'], + ]; + $disabled_reasons = drupal_render($disabled_reasons); + $disabled_header = \Drupal::translation()->formatPlural(count($form['modules'][$module]['#validation_reasons']), + 'The following reason prevents @module from being uninstalled:', + 'The following reasons prevents @module from being uninstalled:', + array('@module' => $form['modules'][$module]['#module_name'])); } $rows[] = array( array('data' => drupal_render($form['uninstall'][$module]), 'align' => 'center'), @@ -326,10 +332,11 @@ function theme_system_modules_uninstall($variables) { array( 'data' => array( '#type' => 'inline_template', - '#template' => '{{ module_description }} {% if disabled_message is not empty %}
{{ disabled_message }}
{% endif %}', + '#template' => '{{ module_description }} {% if disabled_header is not empty %}
{{ disabled_header }}{{ disabled_reasons }}
{% endif %}', '#context' => array( 'module_description' => drupal_render($form['modules'][$module]['description']), - 'disabled_message' => $disabled_message, + 'disabled_header' => $disabled_header, + 'disabled_reasons' => $disabled_reasons, ), ), 'class' => array('description'),