Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
c1e57167
Commit
c1e57167
authored
Apr 05, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1957742
by larowlan: Fixed Can't delete a custom block instance.
parent
d5847d3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
...ock/lib/Drupal/custom_block/CustomBlockFormController.php
+1
-1
core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
...stom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
+5
-0
No files found.
core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockFormController.php
View file @
c1e57167
...
...
@@ -210,7 +210,7 @@ public function delete(array $form, array &$form_state) {
unset
(
$_GET
[
'destination'
]);
}
$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
));
}
}
core/modules/block/custom_block/lib/Drupal/custom_block/Tests/PageEditTest.php
View file @
c1e57167
...
...
@@ -66,6 +66,11 @@ public function testPageEdit() {
// Ensure that the block revision has been created.
$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.'
);
// 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
())));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment