diff --git a/core/lib/Drupal/Core/Extension/ModuleUninstallValidatorInterface.php b/core/lib/Drupal/Core/Extension/ModuleUninstallValidatorInterface.php index 7fcfebe..63599bb 100644 --- a/core/lib/Drupal/Core/Extension/ModuleUninstallValidatorInterface.php +++ b/core/lib/Drupal/Core/Extension/ModuleUninstallValidatorInterface.php @@ -41,7 +41,7 @@ * Each reason should not end with any punctuation since multiple reasons * can be displayed together. * - * @see theme_system_modules_uninstall() + * @see template_preprocess_system_modules_uninstall() */ public function validate($module); } diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 27da4b2..939a736 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -277,7 +277,7 @@ function theme_system_modules_details($variables) { } /** - * Prepares variables for the module uninstall template. + * Prepares variables for module uninstall templates. * * @param $variables * An associative array containing: @@ -289,7 +289,7 @@ function theme_system_modules_details($variables) { * - description: A description of the module. * - #required_by: (optional) A list of modules that require the module. * - #validation_reasons: (optional) Additional reasons why the module - * cannot be disabled. + * cannot be uninstalled. * - #attributes: A list of attributes for the module wrapper. * * @ingroup themeable @@ -314,7 +314,15 @@ function template_preprocess_system_modules_uninstall(&$variables) { $module['reasons_count'] = 0; } if (!empty($module['#required_by'])) { - $module['required_by'] = $module['#required_by']; + // @todo Remove early rendering and use safe_join in the Twig template + // once https://www.drupal.org/2579091 is fixed. + $renderer = \Drupal::service('renderer'); + $required_by = [ + '#theme' => 'item_list', + '#items' => $module['#required_by'], + '#context' => ['list_style' => 'comma-list'], + ]; + $module['required_by'] = t('Required by @module-list', array('@module-list' => $renderer->render($required_by))); $module['reasons_count'] = $module['reasons_count'] + 1; } $module['attributes'] = new Attribute($module['#attributes']); diff --git a/core/modules/system/templates/system-modules-uninstall.html.twig b/core/modules/system/templates/system-modules-uninstall.html.twig index a56a113..b1a98bc 100644 --- a/core/modules/system/templates/system-modules-uninstall.html.twig +++ b/core/modules/system/templates/system-modules-uninstall.html.twig @@ -20,7 +20,6 @@ * @ingroup themeable */ #} - {{ form.filters }} @@ -61,7 +60,7 @@
  • {{ reason }}
  • {% endfor %} {% if module.required_by %} -
  • {{ 'Required by:'|t }} {{ module.required_by|safe_join(', ') }}
  • +
  • {{ module.required_by }}
  • {% endif %}