Problem/Motivation
We discovered in #2975334: Prevent changes that would leak into the Live workspace that some VBO actions might be safe to run in a non-default workspace, for example those that deal with supported (revisionable and publishable) entity types, while others might not be.
Proposed resolution
Use the API provided by #3208390: Add an API for allowing modules to mark their forms as workspace-safe and allow bulk operations for supported entity types.
Remaining tasks
Review.
User interface changes
Nope.
API changes
The API added in #3208390: Add an API for allowing modules to mark their forms as workspace-safe is being extended with a new trait (Drupal\Core\Entity\Form\WorkspaceSafeFormTrait), based on the needs that were observed while implementing support for bulk operations.
Data model changes
Nope.
Issue fork drupal-2986005
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:
- 2986005-workspace-bulk-operations
changes, plain diff MR !7720
Comments
Comment #3
amateescu commentedFix component following module rename.
Comment #14
amateescu commentedIt turns out that the work done in #3208390: Add an API for allowing modules to mark their forms as workspace-safe was pretty much on point and useful for the use cases tackled by this issue.
Some changes in this MR might seem weird, so I'll add some comments on the MR itself to try and explain them directly in a code context.
Comment #15
smustgrave commentedWith the changes to view wonder if it needs sub-maintainer sign off? Thoughts?
Comment #16
amateescu commentedWell.. the MR doesn't change any functionality in Views, so I don't think it's needed here :)
Comment #17
smustgrave commentedRan the test-only feature and got the results here https://git.drupalcode.org/issue/drupal-2986005/-/jobs/1425066
Since workspace isn't marked stable in a released version yet assuming this is fine without a CR.
Reviewing the code believe this is good. Maybe future feature request or contrib module would be a UI to set these.
Comment #18
longwaveI think we should update the change record from #3208390: Add an API for allowing modules to mark their forms as workspace-safe to mention this new trait and link to this issue.
Comment #19
amateescu commented@longwave, good idea, done!
Comment #22
catchCommitted/pushed to 11.x and cherry-picked to 10.3.x, thanks!