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

Command icon 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

s_leu created an issue. See original summary.

s_leu’s picture

Status: Active » Needs review
heddn’s picture

Issue summary: View changes

The 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.

heddn’s picture

Version: 8.x-1.x-dev » 2.x-dev
Status: Needs review » Needs work

Switching versions.

acbramley changed the visibility of the branch 3293558-compare-in-workspaces to hidden.

acbramley changed the visibility of the branch 2.x to hidden.

amateescu made their first commit to this issue’s fork.

amateescu’s picture

Status: Needs work » Reviewed & tested by the community

The current MR looks good to me! I only did a few small changes for phpstan and phpcs, so should be ok to RTBC :)

adamzimmermann’s picture

This seems to have fixed the issue for me too.

amateescu’s picture

Issue tags: +Workspaces support

  • heddn committed 6be5078f on 2.x
    Issue #3293558 by heddn, amateescu, s_leu: Allow usage of revision...
heddn’s picture

Status: Reviewed & tested by the community » Fixed

LGTM. Thanks everyone.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.