Problem/Motivation
It's currently not possible to delete for example a media entity created inside a workspace from within that same workspace via the view bulk form on /admin/content/media . The reason is that DeleteMultipleForm and the ContentEntityDeleteForm are not workspace safe as of now.
Steps to reproduce
On Vanilla Drupal 9.5.x
- Enable wse and the media module
- Create a workspace and switch to it
- At /admin/content/media create a media entity of type image
- Still inside the workspace, delete the created media via the bulk operations form
Expected result: The media can be deleted
Actual result: The views bulk form on /admin/content/media and the confirm form, which the former one leads to after submission, both can't be submitted because they're not workspace safe.
Proposed resolution
Mark the form as workspace safe by swapping the bulk_form views plugin's class to override the BulkForm::viewsForm() method.
Issue fork wse-3342291
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 commentedComment #6
amateescu commentedMerged into 1.0.x, thanks!
Comment #8
s_leu commentedHave to re-open this for a small followup. The DeleteMultipleForm needs to be marked as workspace safe to prevent the submit in live dialog to popup there, as we explicitly want it to be possible to submit this form inside a workspace to delete content that is edited only in this content or its ancestors.
Comment #10
amateescu commentedMerged the followup too, thanks!