only in patch2: unchanged: --- a/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php +++ b/core/modules/forum/lib/Drupal/forum/Form/ForumFormController.php @@ -101,14 +101,23 @@ public function save(array $form, array &$form_state) { /** * {@inheritdoc} */ - public function delete(array $form, array &$form_state) { - $form_state['redirect_route'] = $this->entity->urlInfo('forum-delete-form'); - - $query = $this->getRequest()->query; - if ($query->has('destination')) { - $form_state['redirect_route']['options']['query']['destination'] = $query->get('destination'); - $query->remove('destination'); + protected function actions(array $form, array &$form_state) { + $actions = parent::actions($form, $form_state); + + if ($this->entity->hasLinkTemplate('forum-delete-form') && !$this->entity->isNew()) { + $route_info = $this->entity->urlInfo('forum-delete-form'); + $route_info += array( + 'route_parameters' => array(), + ); + $actions['delete']['#options'] = $route_info['options']; + $actions['delete']['#route_name'] = $route_info['route_name']; + $actions['delete']['#route_parameters'] = $route_info['route_parameters']; + } + else { + unset($actions['delete']); } + + return $actions; } /** only in patch2: unchanged: --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -307,7 +307,7 @@ private function doAdminTests($user) { // Test tags vocabulary form is not affected. $this->drupalGet('admin/structure/taxonomy/manage/tags'); $this->assertFieldByName('op', t('Save'), 'Save button found.'); - $this->assertFieldByName('op', t('Delete'), 'Delete button found.'); + $this->assertLink(t('Delete')); // Test tags vocabulary term form is not affected. $this->drupalGet('admin/structure/taxonomy/manage/tags/add'); $this->assertField('parent[]', 'Parent field found.'); @@ -408,7 +408,8 @@ function createForum($type, $parent = 0) { */ function deleteForum($tid) { // Delete the forum. - $this->drupalPostForm('admin/structure/forum/edit/forum/' . $tid, array(), t('Delete')); + $this->drupalGet('admin/structure/forum/edit/forum/' . $tid); + $this->clickLink(t('Delete')); $this->assertText('Are you sure you want to delete the forum'); $this->assertNoText('Add forum'); $this->assertNoText('Add forum container'); only in patch2: unchanged: --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -297,6 +297,7 @@ protected function actions(array $form, array &$form_state) { array($this, 'submit'), array($this, 'preview'), ), + '#type' => 'submit', ); $element['delete']['#access'] = $node->access('delete'); only in patch2: unchanged: --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php @@ -201,11 +201,13 @@ function testNodeTermCreationAndDeletion() { } // Delete term 1 from the term edit page. - $this->drupalPostForm('taxonomy/term/' . $term_objects['term1']->id() . '/edit', array(), t('Delete')); + $this->drupalGet('taxonomy/term/' . $term_objects['term1']->id() . '/edit'); + $this->clickLink(t('Delete')); $this->drupalPostForm(NULL, NULL, t('Delete')); // Delete term 2 from the term delete page. - $this->drupalPostForm('taxonomy/term/' . $term_objects['term2']->id() . '/delete', array(), t('Delete')); + $this->drupalGet('taxonomy/term/' . $term_objects['term2']->id() . '/delete'); + $this->clickLink(t('Delete')); $term_names = array($term_objects['term3']->label(), $term_objects['term4']->label()); // Get the node. @@ -359,7 +361,8 @@ function testTermInterface() { $this->drupalGet('taxonomy/term/' . $term->id() . '/feed'); // Delete the term. - $this->drupalPostForm('taxonomy/term/' . $term->id() . '/edit', array(), t('Delete')); + $this->drupalGet('taxonomy/term/' . $term->id() . '/edit'); + $this->clickLink(t('Delete')); $this->drupalPostForm(NULL, NULL, t('Delete')); // Assert that the term no longer exists.