Problem/Motivation
The operations for individual blocks on the Block-layout page list are "Edit" and "Delete" (as well as "Disable" in D8.2) so they seem to refer to the actual block, and when clicking on "Delete" they get the message Are you sure you want to delete the block <em>foo</em>?.
However, this does not delete the block, but only removes it from the block-layout. In order to actually delete a custom block, the user needs to do that on the Custom block library page or in the view that creates that block.
Proposed resolution
Replace "Delete" to "Remove".
That way, removing undoes the "Place a block", while "Deleting" undoes the adding of a block on the Custom block library page.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | interdiff.txt | 575 bytes | stmh |
| #23 | replace-delete-by-remove_2806651_23.patch | 4.08 KB | stmh |
| #17 | blocklayout-remove.png | 18.53 KB | ifrik |
| #17 | blocklayout-remove-confirmation.png | 18.46 KB | ifrik |
| #16 | replace-delete-by-remove_2806651_16.patch | 4.22 KB | muschpusch |
Comments
Comment #2
chishah92 commentedComment #3
ifrikchisha92,
I unassign you so that somebody else can take this up.
Comment #4
muschpusch commentedMe and stmh will work on this at dublin2016
Comment #5
yoroy commentedMaybe something for the sprinters today :)
Comment #6
SenneS commentedI'll do this one!
Comment #7
stmh commentedPatch will follow...
Comment #8
stmh commentedHere's a first patch...
Comment #9
muschpusch commentedWe missed one 'delete' action on the edit form. Still working on it
Comment #10
stmh commentedHere's a new patch with no failing tests :)
Comment #11
jeroent.
Comment #12
stmh commentedHi @JeroenT
We met SenneS at the Drupalcon dublin and agreed that he'll review the patch. And as in #4 noted we were first ;-)
Comment #13
tim.plunkettThis can instead be fixed directly in
\Drupal\block\BlockListBuilder::getDefaultOperations(), see the switching of "Edit" to "Configure"I believe the #title should be #value
Unnecessary, please remove.
Either this patch should fail, or there isn't sufficient coverage for the BlockForm change.
Comment #14
muschpusch commentedHey tim.plunkett, regarding
1.) yes
\Drupal\block\BlockListBuilder::getDefaultOperations()Is a lot nicer. Changed that. Thanks for that.
2.) It's not a button but a link. The current value is in #title and not in #value, so i assume it's correct the way we did it.
3.) Removed the additional comment
Why do you think the last patch should let the tests fail?
Thanks for reviewing!
Comment #15
msti@muschpusch The coding tests fail, maybe this is the reason why the test failed testing.
Comment #16
muschpusch commentedThanks msti. Fixed the coding standard warnings.
Comment #17
ifrikI reviewed the UI and the patch works as expected.
On the Block layout page, the operation is labelled "Remove", and on the confirmation page the title and the button both say "Remove" as well.
See screenshots as well.
Comment #18
mstiI tested the patch and it looks good.
Comment #19
tim.plunkettThis should be {@inheritdoc}
There should be a blank line before the end of the class.
Comment #20
ifrikmuschpusch,
thanks a lot for continuing on your patch.
In future, can you make an interdiff? That way the reviewers can easily see what has been changed since your last patch.
There's a detailed description how to do this on https://www.drupal.org/documentation/git/interdiff
Comment #21
ifrikComment #22
stmh commentedthanks for the feedback, will provide a new patch.
Comment #23
stmh commentedAttached is a new patch (and an interdiff) fixing the doc-issue. I can't fix the missing blank line before class-end, looks good at my end and code sniffer is also happy.
Comment #24
tim.plunkettSeems to be there now!
Thanks
Comment #26
webchickNice! It's lovely to have a better label for what's actually happening here. :)
Committed and pushed to 8.3.x. Thanks!
Comment #28
webchickOops. :P
Comment #29
ifrikThanks - this improves sitebuilder usability!
Comment #30
ifriksorry, now I messed up the status