Skip to content
Snippets Groups Projects
Commit 16633608 authored by catch's avatar catch
Browse files

Issue #2071429 by tim.plunkett: Do not inject request via factory method in ForumFormController.

parent 292f51a7
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -40,13 +40,6 @@ class ForumFormController extends TermFormController {
*/
protected $config;
/**
* The current request.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
protected $request;
/**
* Term Storage Controller.
*
......@@ -59,14 +52,11 @@ class ForumFormController extends TermFormController {
*
* @param \Drupal\Core\Config\ConfigFactory $config_factory
* The config factory service.
* @param \Symfony\Component\HttpFoundation\Request $request
* The current request.
* @param \Drupal\taxonomy\TermStorageControllerInterface $storage_controller
* The storage controller.
*/
public function __construct(ConfigFactory $config_factory, Request $request, TermStorageControllerInterface $storage_controller) {
public function __construct(ConfigFactory $config_factory, TermStorageControllerInterface $storage_controller) {
$this->config = $config_factory->get('forum.settings');
$this->request = $request;
$this->storageController = $storage_controller;
}
......@@ -76,7 +66,6 @@ public function __construct(ConfigFactory $config_factory, Request $request, Ter
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('request'),
$container->get('plugin.manager.entity')->getStorageController('taxonomy_term')
);
}
......@@ -154,9 +143,10 @@ public function save(array $form, array &$form_state) {
*/
public function delete(array $form, array &$form_state) {
$destination = array();
if ($this->request->query->get('destination')) {
$request = $this->getRequest();
if ($request->query->has('destination')) {
$destination = drupal_get_destination();
$this->request->query->remove('destination');
$request->query->remove('destination');
}
$term = $this->getEntity($form_state);
$form_state['redirect'] = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment