Skip to content
Snippets Groups Projects
Commit c1e57167 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1957742 by larowlan: Fixed Can't delete a custom block instance.

parent d5847d3f
No related branches found
No related tags found
No related merge requests found
...@@ -210,7 +210,7 @@ public function delete(array $form, array &$form_state) { ...@@ -210,7 +210,7 @@ public function delete(array $form, array &$form_state) {
unset($_GET['destination']); unset($_GET['destination']);
} }
$block = $this->buildEntity($form, $form_state); $block = $this->buildEntity($form, $form_state);
$form_state['redirect'] = array('block/' . $block->uuid->value . '/delete', array('query' => $destination)); $form_state['redirect'] = array('block/' . $block->id() . '/delete', array('query' => $destination));
} }
} }
...@@ -66,6 +66,11 @@ public function testPageEdit() { ...@@ -66,6 +66,11 @@ public function testPageEdit() {
// Ensure that the block revision has been created. // Ensure that the block revision has been created.
$revised_block = entity_load('custom_block', $block->id->value, TRUE); $revised_block = entity_load('custom_block', $block->id->value, TRUE);
$this->assertNotIdentical($block->revision_id->value, $revised_block->revision_id->value, 'A new revision has been created.'); $this->assertNotIdentical($block->revision_id->value, $revised_block->revision_id->value, 'A new revision has been created.');
// Test deleting the block.
$this->drupalGet("block/" . $revised_block->id() . "/edit");
$this->drupalPost(NULL, array(), t('Delete'));
$this->assertText(format_string('Are you sure you want to delete !label?', array('!label' => $revised_block->label())));
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment