Problem/Motivation
The workspaces module is basically built on top of revisions, thus it makes sense to be able to use the comparison diff provides also inside workspaces.
Steps to reproduce
On Vanilla Drupal 9:
- Enable diff and workspaces
- Create an article
- Switch to the Stage workspace
- Edit the content to create a revision
- Click the "Revisions" tab on the node
- Select the revisions and and at the bottom click "Compare selected revisions"(still inside the workspace)
This will fail displaying a message like "This form can only be submitted in the live workspace".
Additionally, see #3442963: Incompatible with diff module where there are some other blockers to supporting this.
Proposed resolution
Using the API which #3208390: Add an API for allowing modules to mark their forms as workspace-safe would introduce, we can add an event subscriber that marks the comparison form "workspace safe".
Also, a mild refactor of the Diff form to make getting the revision IDs easier.
Issue fork diff-3293558
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 #4
heddnThe IS is only one aspect of things needed. There is another bit as seen in #3442963: Incompatible with diff module. Let's bundle both here.
Comment #5
heddnSwitching versions.
Comment #10
amateescu commentedThe current MR looks good to me! I only did a few small changes for phpstan and phpcs, so should be ok to RTBC :)
Comment #11
adamzimmermann commentedThis seems to have fixed the issue for me too.
Comment #12
amateescu commentedComment #14
heddnLGTM. Thanks everyone.