diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index 3d33522..9e43e79 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -239,7 +239,7 @@ public function save(array $form, array &$form_state) { */ public function delete(array $form, array &$form_state) { $destination = array(); - $query = \Drupal::request()->query; + $query = $this->getRequest()->query; if ($query->has('destination')) { $destination = drupal_get_destination(); $query->remove('destination'); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php index d11eefe..952e6bc 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php @@ -347,7 +347,11 @@ function testTermInterface() { $this->drupalGet('taxonomy/term/' . $term->id() . '/feed'); // Delete the term. - $this->drupalPostForm('taxonomy/term/' . $term->id() . '/edit', array(), t('Delete')); + $this->drupalPostForm('taxonomy/term/' . $term->id() . '/edit', array(), t('Delete'), array( + 'query' => array( + 'destination' => 'admin/structure/taxonomy/manage/' . $this->vocabulary->id()), + ) + ); $this->drupalPostForm(NULL, NULL, t('Delete')); // Assert that the term no longer exists.