diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php index 1ec0f70..b5f0e4a 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php @@ -14,6 +14,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\KeyValueStore\KeyValueExpirableFactory; +use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface; use Drupal\Core\Extension\ModuleHandlerInterface; /** @@ -29,11 +30,11 @@ class ModulesUninstallConfirmForm extends ConfirmFormBase implements ControllerI protected $moduleHandler; /** - * The key value expirable factory service. + * The expirable key value store. * - * @var \Drupal\Core\KeyValueStore\KeyValueExpirableFactory + * @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface */ - protected $keyValueExpirableFactory; + protected $keyValueExpirable; /** * The translation manager service. @@ -82,7 +83,7 @@ public static function create(ContainerInterface $container) { */ public function __construct(ModuleHandlerInterface $module_handler, KeyValueExpirableFactory $key_value_expirable_factory, TranslationManager $translation_manager, Request $request) { $this->moduleHandler = $module_handler; - $this->keyValueExpirableFactory = $key_value_expirable_factory; + $this->keyValueExpirable = $key_value_expirable_factory->get('modules_uninstall'); $this->translationManager = $translation_manager; $this->request = $request; } @@ -128,9 +129,7 @@ public function getFormID() { public function buildForm(array $form, array &$form_state) { // Retrieve the list of modules from the key value store. $account = $this->request->attributes->get('account')->id(); - $this->modules = $this->keyValueExpirableFactory - ->get('modules_uninstall') - ->get($account); + $this->modules = $this->keyValueExpirable->get($account); // Prevent this page from showing when the module list is empty. if (empty($this->modules)) { @@ -155,9 +154,7 @@ public function buildForm(array $form, array &$form_state) { public function submitForm(array &$form, array &$form_state) { // Clear the key value store entry. $account = $this->request->attributes->get('account')->id(); - $this->keyValueExpirableFactory - ->get('modules_uninstall') - ->delete($account); + $this->keyValueExpirable->delete($account); // Uninstall the modules. $this->moduleHandler->uninstall($this->modules); diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallForm.php index 64c5180..e27472d 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallForm.php @@ -12,6 +12,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Controller\ControllerInterface; use Drupal\Core\KeyValueStore\KeyValueExpirableFactory; +use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Symfony\Component\HttpFoundation\Request; @@ -28,11 +29,11 @@ class ModulesUninstallForm implements FormInterface, ControllerInterface { protected $moduleHandler; /** - * The key value expirable factory service. + * The expirable key value store. * - * @var \Drupal\Core\KeyValueStore\KeyValueExpirableFactory + * @var \Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface */ - protected $keyValueExpirableFactory; + protected $keyValueExpirable; /** * The translation manager service. @@ -74,7 +75,7 @@ public static function create(ContainerInterface $container) { */ public function __construct(ModuleHandlerInterface $module_handler, KeyValueExpirableFactory $key_value_expirable_factory, TranslationManager $translation_manager, Request $request) { $this->moduleHandler = $module_handler; - $this->keyValueExpirableFactory = $key_value_expirable_factory; + $this->keyValueExpirable = $key_value_expirable_factory->get('modules_uninstall'); $this->translationManager = $translation_manager; $this->request = $request; } @@ -119,7 +120,7 @@ public function buildForm(array $form, array &$form_state) { $form['uninstall'][$module->name] = array( '#type' => 'checkbox', - '#title' => t('Uninstall @module module', array('@module' => $name)), + '#title' => $this->translationManager->translate('Uninstall @module module', array('@module' => $name)), '#title_display' => 'invisible', ); @@ -163,9 +164,7 @@ public function submitForm(array &$form, array &$form_state) { $modules = $form_state['values']['uninstall']; $uninstall = array_keys(array_filter($modules)); $account = $this->request->attributes->get('account')->id(); - $this->keyValueExpirableFactory - ->get('modules_uninstall') - ->setWithExpire($account, $uninstall, 60); + $this->keyValueExpirable->setWithExpire($account, $uninstall, 60); // Redirect to the confirm form. $form_state['redirect'] = 'admin/modules/uninstall/confirm'; diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 55996ce..f9761ba 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -11,9 +11,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; -use Drupal\Core\Datetime\DrupalDateTime; use Drupal\system\Form\ModulesInstallConfirmForm; -use Drupal\system\Form\ModulesUninstallConfirmForm; /** * Menu callback; Provide the administration overview page.