diff -u b/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php --- b/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Entity; +use Drupal\Component\Utility\NestedArray; use Drupal\Core\Entity\Display\EntityFormDisplayInterface; use Drupal\Core\Form\FormBase; use Drupal\Core\Extension\ModuleHandlerInterface; @@ -253,6 +254,9 @@ $route_info += array( 'route_parameters' => array(), ); + $route_info['options'] = NestedArray::mergeDeep($route_info['options'], array( + 'query' => drupal_get_destination(), + )); $actions['delete'] = array( '#type' => 'link', '#title' => $this->t('Delete'), only in patch2: unchanged: --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/VocabularyTest.php @@ -140,8 +140,8 @@ function testTaxonomyAdminDeletingVocabulary() { $this->assertTrue($vocabulary, 'Vocabulary found.'); // Delete the vocabulary. - $edit = array(); - $this->drupalPostForm('admin/structure/taxonomy/manage/' . $vocabulary->id(), $edit, t('Delete')); + $this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary->id()); + $this->clickLink(t('Delete')); $this->assertRaw(t('Are you sure you want to delete the vocabulary %name?', array('%name' => $vocabulary->name)), '[confirm deletion] Asks for confirmation.'); $this->assertText(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'), '[confirm deletion] Inform that all terms will be deleted.');