Problem/Motivation
There are the things in the Add blocks page (Block library listing) which are block plugins. Those hold the description and the body. (for custom block, basic block type). Then there are other things on the Blocks admin listing. Those are block instances of those block plugins. The dropdown buttons on the blocks in the UI on the site, in place in the regions, have items in the dropbutton list (there are also items in the dropbutton list on the block admin list). Some of those items deal with the block plugin: edit, delete. Some deal with the block (block instance): configure.
There is no way to delete the block instance. It seems like the delete for the plugin is what deletes the block (instance). This is confusing. And dangerous.
Proposed resolution
Add a 'Delete block'
Remaining tasks
- Discuss. What are the things on the library listing called? Plugins? Block plugins? What can we call them in the UI? Block library items?
- Create initial patch to change the dropbutton items.
- more tasks to come later...
User interface changes
Yes. Adding a action to the dropbutton.
Before screenshot
Proposed after screenshot
API changes
No API changes.
Related Issues
- (see comment #5) #1994146: WSOD after deleting a custom block content entity
- (very related) #1956496: Custom block contextual links should differentiate between editing/deleting the block instance and the custom block entity
- (very related) remove the 'Delete' (delete plugin) from the inplace edit dropbutton (issue needs to be opened)
- #1956448: Use the block instance title on the block admin listing
- #1871746: Add modal block browser
- #1888702: Use configuration selection instead of derivatives for some blocks
- #1535868: Convert all blocks into plugins
Comment | File | Size | Author |
---|---|---|---|
delete_block.png | 51.08 KB | YesCT | |
inplace_dropbutton.png | 47.04 KB | YesCT |
Comments
Comment #1
xjmComment #2
xjmAlso related (for adding parity between dropbuttons and contextual links, etc.): #1839516: Introduce entity operation providers
Comment #3
xjmRelated: #1834002: Configuration delete operations are all over the place
I think we might want to call it "Remove block" to disambiguate it from deleting the menu, view, custom block entity, etc. Having both "delete" and "delete block" is really confusing.
Comment #4
Bojhan CreditAttribution: Bojhan commentedActually I am not so sure about this idea, we want to make the act of removing content and comments very easily accessible since that is a task often employed.
Although this is also relatively common when you are site building, I am not sure if we should employ a model where you can easily delete each block, each view etc. We now place it on the edit page, consistently which seems to be working quite well - is there a reason we need to elevate this? We need to make sure we don't hog the contextual links with every link we can think of, as the contextual links kind of lose their added value then.
Comment #5
YesCT CreditAttribution: YesCT commentedIf we say that we want the delete to have to go through edit, then we should also not have the delete the plugin there. as deleting the plugin is done even more rarely and is more dangerous than just unplacing it (deleting the block instance).
[edit: added]
Note in the issue summary there is an item that says an issue needs to be opened for:
(very related) remove the 'Delete' (delete plugin) from the inplace edit dropbutton (issue needs to be opened)
Comment #6
Bojhan CreditAttribution: Bojhan commented@YesCT I'd agree.
Comment #7
xjmAgain, not plugin. Plugins are classes, pieces of code. To delete the plugin, you'd have to delete a file in the filesystem:
rm core/modules/some_module/lib/Drupal/some_module/Plugins/block/block/SomeModuleBlock.php
:)Let's please be careful to not confuse people by using the wrong terminology. I think what you are discussing here is deleting either block instances, or objects that provide blocks, like menus, views, aggregator feeds, custom block entities, or whatever. (In the block API, those are the objects that provide derivative definitions).
In any case, I'd agree that it's probably best to standardize on delete only being an operation on the edit form for any object, and not something in the contextual links. So is this wontfix?
Comment #8
quietone CreditAttribution: quietone commentedCreated issue #1994146: WSOD after deleting a custom block content entity for the todo from comment #5
Comment #9
quietone CreditAttribution: quietone commentedComment #9.0
quietone CreditAttribution: quietone commentedNew issue created from discussion