diff --git a/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php b/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php index eee3b5f..c365f37 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityDeleteForm.php @@ -19,7 +19,7 @@ class ContentEntityDeleteForm extends ContentEntityConfirmFormBase { * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to delete the @entity-type %label', array( + return t('Are you sure you want to delete the @entity-type %label?', array( '@entity-type' => $this->entity->getEntityType()->getLowercaseLabel(), '%label' => $this->entity->label(), )); diff --git a/core/lib/Drupal/Core/Entity/EntityDeleteForm.php b/core/lib/Drupal/Core/Entity/EntityDeleteForm.php index 6062355..e946ed6 100644 --- a/core/lib/Drupal/Core/Entity/EntityDeleteForm.php +++ b/core/lib/Drupal/Core/Entity/EntityDeleteForm.php @@ -21,7 +21,7 @@ class EntityDeleteForm extends EntityConfirmFormBase { * {@inheritdoc} */ public function getQuestion() { - return t('Are you sure you want to delete the @entity-type %label', array( + return t('Are you sure you want to delete the @entity-type %label?', array( '@entity-type' => $this->entity->getEntityType()->getLowercaseLabel(), '%label' => $this->entity->label(), )); diff --git a/core/modules/aggregator/src/Form/FeedDeleteForm.php b/core/modules/aggregator/src/Form/FeedDeleteForm.php index 8043409..7ebba1c 100644 --- a/core/modules/aggregator/src/Form/FeedDeleteForm.php +++ b/core/modules/aggregator/src/Form/FeedDeleteForm.php @@ -26,6 +26,15 @@ public function getCancelUrl() { /** * {@inheritdoc} */ + public function getDeletionMessage() { + return $this->t('The feed %label has been deleted.', array( + '%label' => $this->entity->label(), + )); + } + + /** + * {@inheritdoc} + */ public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); $this->logger('aggregator')->notice('Feed %feed deleted.', array('%feed' => $this->entity->label())); diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php index 9c30e10..84ab995 100644 --- a/core/modules/block/src/Tests/BlockTest.php +++ b/core/modules/block/src/Tests/BlockTest.php @@ -171,7 +171,7 @@ function testBlock() { $this->clickLink(t('Delete')); $this->assertRaw(t('Are you sure you want to delete the block %name?', array('%name' => $block['settings[label]']))); $this->drupalPostForm(NULL, array(), t('Delete')); - $this->assertRaw(t('The block %name has been removed.', array('%name' => $block['settings[label]']))); + $this->assertRaw(t('The block %name has been deleted.', array('%name' => $block['settings[label]']))); // Test deleting a block via "Configure block" link. $block = $this->drupalPlaceBlock('system_powered_by_block'); @@ -179,7 +179,7 @@ function testBlock() { $this->clickLink(t('Delete')); $this->assertRaw(t('Are you sure you want to delete the block %name?', array('%name' => $block->label()))); $this->drupalPostForm(NULL, array(), t('Delete')); - $this->assertRaw(t('The block %name has been removed.', array('%name' => $block->label()))); + $this->assertRaw(t('The block %name has been deleted.', array('%name' => $block->label()))); $this->assertUrl('admin'); $this->assertNoRaw($block->id()); } diff --git a/core/modules/block_content/src/Form/BlockContentDeleteForm.php b/core/modules/block_content/src/Form/BlockContentDeleteForm.php index 71326bc..31a3e7e 100644 --- a/core/modules/block_content/src/Form/BlockContentDeleteForm.php +++ b/core/modules/block_content/src/Form/BlockContentDeleteForm.php @@ -20,7 +20,7 @@ class BlockContentDeleteForm extends ContentEntityDeleteForm { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('block.admin_display'); + return new Url('block_content.list'); } /** @@ -43,6 +43,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); $this->logger('block_content')->notice('Custom block %label has been deleted.', array('%label' => $this->entity->label())); + $form_state->setRedirect('block_content.list'); } } diff --git a/core/modules/block_content/src/Tests/BlockContentCreationTest.php b/core/modules/block_content/src/Tests/BlockContentCreationTest.php index 7797571..5d64e58 100644 --- a/core/modules/block_content/src/Tests/BlockContentCreationTest.php +++ b/core/modules/block_content/src/Tests/BlockContentCreationTest.php @@ -187,7 +187,7 @@ public function testBlockDelete() { $this->assertText(format_plural(1, 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instance.')); $this->drupalPostForm(NULL, array(), 'Delete'); - $this->assertRaw(t('Custom block %name has been deleted.', array('%name' => $edit['info[0][value]']))); + $this->assertRaw(t('The custom block %name has been deleted.', array('%name' => $edit['info[0][value]']))); // Create another block and force the plugin cache to flush. $edit2 = array(); diff --git a/core/modules/block_content/src/Tests/BlockContentListTest.php b/core/modules/block_content/src/Tests/BlockContentListTest.php index c644286..57c9d27 100644 --- a/core/modules/block_content/src/Tests/BlockContentListTest.php +++ b/core/modules/block_content/src/Tests/BlockContentListTest.php @@ -99,7 +99,7 @@ public function testListing() { $delete_text = t('Delete'); $this->clickLink($delete_text); $this->assertResponse(200); - $this->assertTitle(strip_tags(t('Are you sure you want to delete %label?', array('%label' => $new_label)) . ' | Drupal')); + $this->assertTitle(strip_tags(t('Are you sure you want to delete the custom block %label?', array('%label' => $new_label)) . ' | Drupal')); $this->drupalPostForm(NULL, array(), $delete_text); // Verify that the text of the label and machine name does not appear in diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php index 60f1210..0a1b77e 100644 --- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php @@ -126,7 +126,7 @@ public function testBlockContentTypeDeletion() { // Attempt to delete the block type, which should now be allowed. $this->drupalGet('admin/structure/block/block-content/manage/' . $type->id() . '/delete'); $this->assertRaw( - t('Are you sure you want to delete %type?', array('%type' => $type->id())), + t('Are you sure you want to delete the custom block type %type?', array('%type' => $type->id())), 'The block type is available for deletion.' ); $this->assertText(t('This action cannot be undone.'), 'The custom block type deletion confirmation form is available.'); diff --git a/core/modules/block_content/src/Tests/PageEditTest.php b/core/modules/block_content/src/Tests/PageEditTest.php index 3577547..ef56ad3 100644 --- a/core/modules/block_content/src/Tests/PageEditTest.php +++ b/core/modules/block_content/src/Tests/PageEditTest.php @@ -61,7 +61,7 @@ public function testPageEdit() { // Test deleting the block. $this->drupalGet("block/" . $revised_block->id()); $this->clickLink(t('Delete')); - $this->assertText(format_string('Are you sure you want to delete !label?', array('!label' => $revised_block->label()))); + $this->assertText(format_string('Are you sure you want to delete the custom block !label?', array('!label' => $revised_block->label()))); } } diff --git a/core/modules/comment/src/Tests/CommentTypeTest.php b/core/modules/comment/src/Tests/CommentTypeTest.php index 148d1ef..c02b4dd 100644 --- a/core/modules/comment/src/Tests/CommentTypeTest.php +++ b/core/modules/comment/src/Tests/CommentTypeTest.php @@ -169,7 +169,7 @@ public function testCommentTypeDeletion() { // Attempt to delete the comment type, which should now be allowed. $this->drupalGet('admin/structure/comment/manage/' . $type->id() . '/delete'); $this->assertRaw( - t('Are you sure you want to delete %type?', array('%type' => $type->id())), + t('Are you sure you want to delete the comment type %type?', array('%type' => $type->id())), 'The comment type is available for deletion.' ); $this->assertText(t('This action cannot be undone.'), 'The comment type deletion confirmation form is available.'); @@ -186,7 +186,7 @@ public function testCommentTypeDeletion() { // Delete the comment type. $this->drupalPostForm('admin/structure/comment/manage/' . $type->id() . '/delete', array(), t('Delete')); $this->assertNull(CommentType::load($type->id()), 'Comment type deleted.'); - $this->assertRaw(t('Comment type %label has been deleted.', array('%label' => $type->label()))); + $this->assertRaw(t('The comment type %label has been deleted.', array('%label' => $type->label()))); } } diff --git a/core/modules/config/src/Tests/ConfigEntityTest.php b/core/modules/config/src/Tests/ConfigEntityTest.php index 4bdbe25..1514f3f 100644 --- a/core/modules/config/src/Tests/ConfigEntityTest.php +++ b/core/modules/config/src/Tests/ConfigEntityTest.php @@ -240,7 +240,7 @@ function testCRUDUI() { $label3 = $this->randomMachineName(); $message_insert = format_string('%label configuration has been created.', array('%label' => $label1)); $message_update = format_string('%label configuration has been updated.', array('%label' => $label2)); - $message_delete = format_string('%label configuration has been deleted.', array('%label' => $label2)); + $message_delete = format_string('The test configuration %label has been deleted.', array('%label' => $label2)); // Create a configuration entity. $edit = array( diff --git a/core/modules/field_ui/src/Tests/EntityDisplayModeTest.php b/core/modules/field_ui/src/Tests/EntityDisplayModeTest.php index a6ef8ee..7b7fe12 100644 --- a/core/modules/field_ui/src/Tests/EntityDisplayModeTest.php +++ b/core/modules/field_ui/src/Tests/EntityDisplayModeTest.php @@ -65,9 +65,9 @@ public function testEntityViewModeUI() { // Test deleting the view mode. $this->clickLink(t('Delete')); - $this->assertRaw(t('Are you sure you want to delete the %label view mode?', array('%label' => $edit['label']))); + $this->assertRaw(t('Are you sure you want to delete the view mode %label?', array('%label' => $edit['label']))); $this->drupalPostForm(NULL, NULL, t('Delete')); - $this->assertRaw(t('Deleted the %label view mode.', array('%label' => $edit['label']))); + $this->assertRaw(t('The view mode %label has been deleted.', array('%label' => $edit['label']))); } /** @@ -111,9 +111,9 @@ public function testEntityFormModeUI() { // Test deleting the form mode. $this->clickLink(t('Delete')); - $this->assertRaw(t('Are you sure you want to delete the %label form mode?', array('%label' => $edit['label']))); + $this->assertRaw(t('Are you sure you want to delete the form mode %label?', array('%label' => $edit['label']))); $this->drupalPostForm(NULL, NULL, t('Delete')); - $this->assertRaw(t('Deleted the %label form mode.', array('%label' => $edit['label']))); + $this->assertRaw(t('The form mode %label has been deleted.', array('%label' => $edit['label']))); } } diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php index 8426337..df068ee 100644 --- a/core/modules/image/src/Tests/ImageAdminStylesTest.php +++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php @@ -327,7 +327,7 @@ function testStyleReplacement() { 'replacement' => 'thumbnail', ); $this->drupalPostForm($style_path . $new_style_name . '/delete', $edit, t('Delete')); - $message = t('Style %name was deleted.', array('%name' => $new_style_label)); + $message = t('The image style %name has been deleted.', array('%name' => $new_style_label)); $this->assertRaw($message); $replacement_style = entity_load('image_style', 'thumbnail'); diff --git a/core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php b/core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php index 39e724d..ae742c6 100644 --- a/core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php +++ b/core/modules/menu_link_content/src/Form/MenuLinkContentDeleteForm.php @@ -59,11 +59,17 @@ public function getCancelUrl() { /** * {@inheritdoc} */ + public function getDeletionMessage() { + return $this->t('The menu link %title has been deleted.', array('%title' => $this->entity->label())); + } + + /** + * {@inheritdoc} + */ public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); $t_args = array('%title' => $this->entity->getTitle()); $this->logger->notice('Deleted menu link %title.', $t_args); - $form_state->setRedirect(''); } } diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php index 6da1e93..2543ac2 100644 --- a/core/modules/menu_ui/src/Tests/MenuTest.php +++ b/core/modules/menu_ui/src/Tests/MenuTest.php @@ -728,7 +728,7 @@ function deleteMenuLink(MenuLinkContent $item) { $title = $item->getTitle(); // Delete menu link. - $this->drupalPostForm("admin/structure/menu/item/$mlid/delete", array(), t('Confirm')); + $this->drupalPostForm("admin/structure/menu/item/$mlid/delete", array(), t('Delete')); $this->assertResponse(200); $this->assertRaw(t('The menu link %title has been deleted.', array('%title' => $title)), 'Menu link was deleted'); diff --git a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php index 7d99214..45a9e8f 100644 --- a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php +++ b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php @@ -309,9 +309,9 @@ public function testMultipleSearchPages() { // Test deleting. $this->clickLink(t('Delete')); - $this->assertRaw(t('Are you sure you want to delete the %label search page?', array('%label' => $first['label']))); + $this->assertRaw(t('Are you sure you want to delete the search page %label?', array('%label' => $first['label']))); $this->drupalPostForm(NULL, array(), t('Delete')); - $this->assertRaw(t('The %label search page has been deleted.', array('%label' => $first['label']))); + $this->assertRaw(t('The search page %label has been deleted.', array('%label' => $first['label']))); $this->verifySearchPageOperations($first_id, FALSE, FALSE, FALSE, FALSE); } diff --git a/core/modules/system/src/Tests/Entity/EntityFormTest.php b/core/modules/system/src/Tests/Entity/EntityFormTest.php index ce12dfe..307b69a 100644 --- a/core/modules/system/src/Tests/Entity/EntityFormTest.php +++ b/core/modules/system/src/Tests/Entity/EntityFormTest.php @@ -79,7 +79,7 @@ protected function doTestFormCRUD($entity_type) { $this->drupalGet($entity_type . '/manage/' . $entity->id()); $this->clickLink(t('Delete')); - $this->drupalPostForm(NULL, array(), t('Confirm')); + $this->drupalPostForm(NULL, array(), t('Delete')); $entity = $this->loadEntityByName($entity_type, $name2); $this->assertFalse($entity, format_string('%entity_type: Entity not found in the database.', array('%entity_type' => $entity_type))); } diff --git a/core/modules/system/src/Tests/System/DateTimeTest.php b/core/modules/system/src/Tests/System/DateTimeTest.php index fa87fc9..bfe0c85 100644 --- a/core/modules/system/src/Tests/System/DateTimeTest.php +++ b/core/modules/system/src/Tests/System/DateTimeTest.php @@ -111,9 +111,9 @@ function testDateFormatConfiguration() { // Delete custom date format. $this->clickLink(t('Delete')); - $this->drupalPostForm('admin/config/regional/date-time/formats/manage/' . $date_format_id . '/delete', array(), t('Remove')); + $this->drupalPostForm('admin/config/regional/date-time/formats/manage/' . $date_format_id . '/delete', array(), t('Delete')); $this->assertUrl(\Drupal::url('system.date_format_list', [], ['absolute' => TRUE]), [], 'Correct page redirection.'); - $this->assertRaw(t('Removed date format %format.', array('%format' => $name)), 'Custom date format removed.'); + $this->assertRaw(t('The date format %format has been deleted.', array('%format' => $name)), 'Custom date format removed.'); // Make sure the date does not exist in config. $date_format = entity_load('date_format', $date_format_id); diff --git a/core/modules/taxonomy/src/Form/TermDeleteForm.php b/core/modules/taxonomy/src/Form/TermDeleteForm.php index 91fc7e4..8a462c4 100644 --- a/core/modules/taxonomy/src/Form/TermDeleteForm.php +++ b/core/modules/taxonomy/src/Form/TermDeleteForm.php @@ -9,8 +9,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\ContentEntityDeleteForm; /** @@ -42,6 +40,20 @@ public function getDescription() { /** * {@inheritdoc} */ + public function getQuestion() { + return $this->t('Are you sure you want to delete the term %name?', array('%name' => $this->entity->label())); + } + + /** + * {@inheritdoc} + */ + public function getDeletionMessage() { + return $this->t('Deleted term %name.', array('%name' => $this->entity->label())); + } + + /** + * {@inheritdoc} + */ public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); diff --git a/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php b/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php index 447494c..aa81fd3 100644 --- a/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php +++ b/core/modules/taxonomy/src/Form/VocabularyDeleteForm.php @@ -40,6 +40,20 @@ public function getDescription() { /** * {@inheritdoc} */ + public function getQuestion() { + return $this->t('Are you sure you want to delete the vocabulary %name?', array('%name' => $this->entity->label())); + } + + /** + * {@inheritdoc} + */ + public function getDeletionMessage() { + return $this->t('Deleted vocabulary %name.', array('%name' => $this->entity->label())); + } + + /** + * {@inheritdoc} + */ public function submitForm(array &$form, FormStateInterface $form_state) { parent::submitForm($form, $form_state); diff --git a/core/modules/user/src/Tests/UserRoleAdminTest.php b/core/modules/user/src/Tests/UserRoleAdminTest.php index 427ad8f..26f4d00 100644 --- a/core/modules/user/src/Tests/UserRoleAdminTest.php +++ b/core/modules/user/src/Tests/UserRoleAdminTest.php @@ -66,7 +66,7 @@ function testRoleAdministration() { $this->drupalGet("admin/people/roles/manage/{$role->id()}"); $this->clickLink(t('Delete')); $this->drupalPostForm(NULL, array(), t('Delete')); - $this->assertRaw(t('Role %label has been deleted.', array('%label' => $role_name))); + $this->assertRaw(t('The role %label has been deleted.', array('%label' => $role_name))); $this->assertNoLinkByHref("admin/people/roles/manage/{$role->id()}", 'Role edit link removed.'); \Drupal::entityManager()->getStorage('user_role')->resetCache(array($role->id())); $this->assertFalse(Role::load($role->id()), 'A deleted role can no longer be loaded.'); diff --git a/core/modules/views_ui/src/Tests/ViewEditTest.php b/core/modules/views_ui/src/Tests/ViewEditTest.php index 1dd7e0e..b46dd6b 100644 --- a/core/modules/views_ui/src/Tests/ViewEditTest.php +++ b/core/modules/views_ui/src/Tests/ViewEditTest.php @@ -38,7 +38,7 @@ public function testDeleteLink() { $this->clickLink(t('Delete view')); $this->assertUrl('admin/structure/views/view/test_view/delete'); $this->drupalPostForm(NULL, array(), t('Delete')); - $this->assertRaw(t('View %name deleted', array('%name' => $view->label()))); + $this->assertRaw(t('The view %name has been deleted.', array('%name' => $view->label()))); $this->assertUrl('admin/structure/views'); $view = $this->container->get('entity.manager')->getStorage('view')->load('test_view');