diff -u b/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php
--- b/core/modules/system/src/Form/ModulesListForm.php
+++ b/core/modules/system/src/Form/ModulesListForm.php
@@ -7,6 +7,7 @@
namespace Drupal\system\Form;
+use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Controller\TitleResolverInterface;
@@ -416,9 +417,7 @@
}
// Set id for checkbox here so module label can reference it.
- $id = drupal_html_class('edit-modules-' . $module->info['package'] . '-' . $module->getName() . '-enable');
-
- $row['name']['#markup'] = $module->info['name'];
+ $id = Html::getClass('edit-modules-' . $module->info['package'] . '-' . $module->getName() . '-enable');
$row['enable'] += array(
'#id' => $id,
@@ -427,9 +426,13 @@
// Add the module label and expand/collapse functionality.
$row['name'] = array(
- '#prefix' => '',
+ '#type' => 'inline_template',
+ '#template' => '',
+ '#context' => array(
+ 'machine_name' => $module->getName(),
+ 'label_id' => $id,
+ 'module_name' => $module->info['name'],
+ ),
'#wrapper_attributes' => array(
'class' => array('module'),
),