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

inplace_dropbutton.png

Proposed after screenshot

delete_block.png

API changes

No API changes.

Related Issues

CommentFileSizeAuthor
delete_block.png51.08 KBYesCT
inplace_dropbutton.png47.04 KBYesCT
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm’s picture

Title: Add block instance delete to inplace dropbutton on block instance » Add block instance delete to block contextual links
xjm’s picture

Also related (for adding parity between dropbuttons and contextual links, etc.): #1839516: Introduce entity operation providers

xjm’s picture

Related: #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.

Bojhan’s picture

Actually 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.

YesCT’s picture

If 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)

Bojhan’s picture

@YesCT I'd agree.

xjm’s picture

'Delete' (delete plugin) from the inplace edit dropbutton (issue needs to be opened)

Again, 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?

quietone’s picture

Created issue #1994146: WSOD after deleting a custom block content entity for the todo from comment #5

quietone’s picture

Status: Active » Closed (won't fix)
quietone’s picture

Issue summary: View changes

New issue created from discussion