diff --git a/core/modules/block/custom_block/custom_block.routing.yml b/core/modules/block/custom_block/custom_block.routing.yml index 41c1446..3574d0e 100644 --- a/core/modules/block/custom_block/custom_block.routing.yml +++ b/core/modules/block/custom_block/custom_block.routing.yml @@ -15,10 +15,7 @@ custom_block_add_page: custom_block_delete: pattern: '/block/{custom_block}/delete' - options: - converters: - custom_block: 'custom_block' defaults: _form: '\Drupal\custom_block\Form\CustomBlockDeleteForm' requirements: - _entity_access: 'custom_block.view' + _entity_access: 'custom_block.delete' diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockDeleteForm.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockDeleteForm.php index 462ac79..0e0d35f 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockDeleteForm.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockDeleteForm.php @@ -11,7 +11,7 @@ use Drupal\custom_block\Plugin\Core\Entity\CustomBlock; /** - * Provides a deletion confirmation form for the block instance deletion form. + * Provides a deletion confirmation form for the block content entity form. */ class CustomBlockDeleteForm extends ConfirmFormBase { @@ -33,7 +33,7 @@ public function getFormID() { * {@inheritdoc} */ protected function getQuestion() { - return t('Are you sure you want to delete the block %name?', array('%name' => $this->block->label())); + return t('Are you sure you want to delete %name', array('%name' => $this->block->label())); } /** @@ -53,8 +53,8 @@ protected function getConfirmText() { /** * {@inheritdoc} * - * @param \Drupal\custom_block\Plugin\Core\Entity\CustomBlock $block - * The block instance. + * @param \Drupal\custom_block\Plugin\Core\Entity\CustomBlock $custom_block + * The custom block entity. */ public function buildForm(array $form, array &$form_state, CustomBlock $custom_block = NULL) { $this->block = $custom_block; @@ -67,7 +67,8 @@ public function buildForm(array $form, array &$form_state, CustomBlock $custom_b public function submitForm(array &$form, array &$form_state) { // @todo Delete all configured instances of the block. $this->block->delete(); - drupal_set_message(t('The block %name has been removed.', array('%name' => $this->block->label()))); + drupal_set_message(t('Custom block %label has been deleted.', array('%label' => $this->block->label()))); + watchdog('custom_block', 'Custom block %label has been deleted.', array('%label' => $this->block->label()), WATCHDOG_NOTICE); $form_state['redirect'] = 'admin/structure/block'; }