Problem/Motivation
Given an node is being edited inside workspace, or in other words has an active revision inside a workspace, it is currently still possible to delete it via the delete action on the content overview. Via the delete operations link, this does not work, thus the action shouldn't be allowed to delete a node or any entity that's being inside a workspace either.
Steps to reproduce
On vanilla Drupal 9 or 10
- Enable the workspaces module
- Create a workspace
- Create content in the newly created workspace
- Switch back to the LIVE version of the site
- Navigate to /admin/content
- Check the checkbox on the very left column of the table in the row of the content created above
- In the Action dropdown, select
Delete content - Click on
Apply to selected itemsand confirm in the next step
Result: Content will get deleted.
Proposed resolution
Implement form altering for the DeleteMultipleForm to make sure, deleting via the action is not possible if
- The entity can be used aka is supported inside workspaces
- The entity has an active revision in any workspace
Issue fork wse-3333250
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
s_leu commentedLooking at this a bit more, it turned out that overriding the DeleteAction plugin was easier than altering the form.
Comment #4
s_leu commentedComment #5
s_leu commentedComment #8
amateescu commentedMerged into 1.0.x, thanks!