diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListConfirmForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListConfirmForm.php index a3a9bbb..d5a92f4 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListConfirmForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListConfirmForm.php @@ -63,8 +63,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('module_handler'), $container->get('keyvalue.expirable'), - $container->get('string_translation'), - $container->get('request') + $container->get('string_translation') ); } @@ -77,14 +76,11 @@ public static function create(ContainerInterface $container) { * The key value expirable factory. * @param \Drupal\Core\StringTranslation\TranslationManager * The translation manager. - * @param \Symfony\Component\HttpFoundation\Request $request - * The request object. */ - public function __construct(ModuleHandlerInterface $module_handler, KeyValueExpirableFactory $key_value_expirable_factory, TranslationManager $translation_manager, Request $request) { + public function __construct(ModuleHandlerInterface $module_handler, KeyValueExpirableFactory $key_value_expirable_factory, TranslationManager $translation_manager) { $this->moduleHandler = $module_handler; $this->keyValueExpirable = $key_value_expirable_factory->get('module_list'); $this->translationManager = $translation_manager; - $this->request = $request; } /** @@ -125,8 +121,8 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, array &$form_state) { - $account = $this->request->attributes->get('account')->id(); + public function buildForm(array $form, array &$form_state, Request $request = NULL) { + $account = $request->attributes->get('account')->id(); $this->modules = $this->keyValueExpirable->get($account); // Redirect to the modules list page if the key value store is empty. @@ -134,6 +130,9 @@ public function buildForm(array $form, array &$form_state) { return new RedirectResponse(url($this->getCancelPath(), array('absolute' => TRUE))); } + // Store the request for use in the submit handler. + $this->request = $request; + $items = array(); // Display a list of required modules that have to be installed as well but // were not manually selected. diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index 53a9fb9..58a343c 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -61,8 +61,7 @@ public static function create(ContainerInterface $container) { return new static( $container->get('module_handler'), $container->get('keyvalue.expirable'), - $container->get('string_translation'), - $container->get('request') + $container->get('string_translation') ); } @@ -75,14 +74,11 @@ public static function create(ContainerInterface $container) { * The key value expirable factory. * @param \Drupal\Core\StringTranslation\TranslationManager * The translation manager. - * @param \Symfony\Component\HttpFoundation\Request $request - * The request object. */ - public function __construct(ModuleHandlerInterface $module_handler, KeyValueExpirableFactory $key_value_expirable_factory, TranslationManager $translation_manager, Request $request) { + public function __construct(ModuleHandlerInterface $module_handler, KeyValueExpirableFactory $key_value_expirable_factory, TranslationManager $translation_manager) { $this->moduleHandler = $module_handler; $this->keyValueExpirable = $key_value_expirable_factory->get('module_list'); $this->translationManager = $translation_manager; - $this->request = $request; } /** @@ -95,13 +91,16 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, array &$form_state) { + public function buildForm(array $form, array &$form_state, Request $request = NULL) { require_once DRUPAL_ROOT . '/core/includes/install.inc'; $distribution = check_plain(drupal_install_profile_distribution_name()); // Include system.admin.inc so we can use the sort callbacks. $this->moduleHandler->loadInclude('system', 'inc', 'system.admin'); + // Store the request for use in the submit handler. + $this->request = $request; + $form['filters'] = array( '#type' => 'container', '#attributes' => array( @@ -266,9 +265,10 @@ protected function buildRow(array $modules, $module, $distribution) { // If this module is not compatible, disable the checkbox. if (!$compatible) { $row['enable']['#disabled'] = TRUE; - $row['description']['#markup'] .= theme('system_modules_incompatible', array( - 'message' => $status, - )); + $row['description'] = array( + '#theme' => 'system_modules_incompatible', + '#message' => $status, + ); } // If this module requires other modules, add them to the array.