diff --git a/core/modules/search/lib/Drupal/search/Form/SearchPageFormBase.php b/core/modules/search/lib/Drupal/search/Form/SearchPageFormBase.php index e3f0763..9e2718d 100644 --- a/core/modules/search/lib/Drupal/search/Form/SearchPageFormBase.php +++ b/core/modules/search/lib/Drupal/search/Form/SearchPageFormBase.php @@ -181,4 +181,16 @@ public function save(array $form, array &$form_state) { $form_state['redirect_route']['route_name'] = 'search.settings'; } + /** + * {@inheritdoc} + */ + public function delete(array $form, array &$form_state) { + $form_state['redirect_route'] = array( + 'route_name' => 'search.delete', + 'route_parameters' => array( + 'search_page' => $this->entity->id(), + ), + ); + } + } diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php index eb6abe8..84934e0 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php @@ -293,6 +293,13 @@ public function testMultipleSearchPages() { $this->assertResponse(200); $this->verifySearchPageOperations($first_id, TRUE, TRUE, TRUE, FALSE); $this->verifySearchPageOperations($second_id, TRUE, FALSE, FALSE, FALSE); + + // Test deleting. + $this->clickLink(t('Delete')); + $this->assertRaw(t('Are you sure you want to delete the %label search?', array('%label' => $first['label']))); + $this->drupalPostForm(NULL, array(), t('Delete')); + $this->assertRaw(t('The %label search has been deleted.', array('%label' => $first['label']))); + $this->verifySearchPageOperations($first_id, FALSE, FALSE, FALSE, FALSE); } /**