diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index 701e237..2afb728 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -9,6 +9,7 @@ use Drupal\Core\Entity\EntityFormControllerNG; use Drupal\Core\Language\Language; +use Symfony\Component\HttpFoundation\Request; /** * Base for controller for taxonomy term edit forms. @@ -16,6 +17,21 @@ class TermFormController extends EntityFormControllerNG { /** + * The current request. + * + * @var \Symfony\Component\HttpFoundation\Request + */ + protected $request; + + /** + * {@inheritdoc} + */ + public function buildForm(array $form, array &$form_state, Request $request) { + $this->request = $request; + return parent::buildForm($form, $form_state); + } + + /** * Overrides Drupal\Core\Entity\EntityFormController::form(). */ public function form(array $form, array &$form_state) { @@ -199,8 +215,7 @@ public function save(array $form, array &$form_state) { */ public function delete(array $form, array &$form_state) { $destination = array(); - $query = \Drupal::request()->query; - if ($query->has('destination')) { + if ($this->request->query->has('destination')) { $destination = drupal_get_destination(); } $form_state['redirect'] = array('taxonomy/term/' . $this->entity->id() . '/delete', array('query' => $destination)); diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc index b172fa9..5830b2c 100644 --- a/core/modules/taxonomy/taxonomy.admin.inc +++ b/core/modules/taxonomy/taxonomy.admin.inc @@ -280,9 +280,9 @@ function taxonomy_overview_terms($form, &$form_state, Vocabulary $vocabulary) { ); $options = array(); - if (Drupal::request()->query->has('page')) { + if ($page = Drupal::request()->query->get('page')) { $options['query'] = array( - 'page' => Drupal::request()->query->get('page'), + 'page' => $page, ); } $form_state['redirect'] = array(current_path(), $options);