Issue #2071429 by tim.plunkett: Do not inject request via factory method in ForumFormController.
parent
292f51a7a4
commit
16633608f7
|
@ -40,13 +40,6 @@ class ForumFormController extends TermFormController {
|
||||||
*/
|
*/
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
/**
|
|
||||||
* The current request.
|
|
||||||
*
|
|
||||||
* @var \Symfony\Component\HttpFoundation\Request
|
|
||||||
*/
|
|
||||||
protected $request;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Term Storage Controller.
|
* Term Storage Controller.
|
||||||
*
|
*
|
||||||
|
@ -59,14 +52,11 @@ class ForumFormController extends TermFormController {
|
||||||
*
|
*
|
||||||
* @param \Drupal\Core\Config\ConfigFactory $config_factory
|
* @param \Drupal\Core\Config\ConfigFactory $config_factory
|
||||||
* The config factory service.
|
* The config factory service.
|
||||||
* @param \Symfony\Component\HttpFoundation\Request $request
|
|
||||||
* The current request.
|
|
||||||
* @param \Drupal\taxonomy\TermStorageControllerInterface $storage_controller
|
* @param \Drupal\taxonomy\TermStorageControllerInterface $storage_controller
|
||||||
* The 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->config = $config_factory->get('forum.settings');
|
||||||
$this->request = $request;
|
|
||||||
$this->storageController = $storage_controller;
|
$this->storageController = $storage_controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +66,6 @@ class ForumFormController extends TermFormController {
|
||||||
public static function create(ContainerInterface $container) {
|
public static function create(ContainerInterface $container) {
|
||||||
return new static(
|
return new static(
|
||||||
$container->get('config.factory'),
|
$container->get('config.factory'),
|
||||||
$container->get('request'),
|
|
||||||
$container->get('plugin.manager.entity')->getStorageController('taxonomy_term')
|
$container->get('plugin.manager.entity')->getStorageController('taxonomy_term')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -154,9 +143,10 @@ class ForumFormController extends TermFormController {
|
||||||
*/
|
*/
|
||||||
public function delete(array $form, array &$form_state) {
|
public function delete(array $form, array &$form_state) {
|
||||||
$destination = array();
|
$destination = array();
|
||||||
if ($this->request->query->get('destination')) {
|
$request = $this->getRequest();
|
||||||
|
if ($request->query->has('destination')) {
|
||||||
$destination = drupal_get_destination();
|
$destination = drupal_get_destination();
|
||||||
$this->request->query->remove('destination');
|
$request->query->remove('destination');
|
||||||
}
|
}
|
||||||
$term = $this->getEntity($form_state);
|
$term = $this->getEntity($form_state);
|
||||||
$form_state['redirect'] = array(
|
$form_state['redirect'] = array(
|
||||||
|
|
Loading…
Reference in New Issue