Entities edited in a workspace can be deleted via bulk operation

Created on 13 January 2023, about 2 years ago
Updated 7 February 2023, about 2 years ago

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

  1. Enable the workspaces module
  2. Create a workspace
  3. Create content in the newly created workspace
  4. Switch back to the LIVE version of the site
  5. Navigate to /admin/content
  6. Check the checkbox on the very left column of the table in the row of the content created above
  7. In the Action dropdown, select Delete content
  8. Click on Apply to selected items and 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
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024