Problem/Motivation

When viewing the revision tab of an entity inside a workspace, it's currently not possible to even see any other revisions than the ones created inside that workspace. So no live revisions are listed and as a consequence, it's neither possible to revert to live revisions while it should actually be possible.

The diff module should also be supported, meaning it should be possible to diff to live revisions.

This should eventually be solved in core workspaces, but I'm creating this here first to push some WIP code and a PoC first.

Steps to reproduce

  • Create a node in live, save it and create one more revision
  • Switch to a workspace
  • Create two more revisions inside the workspace
  • Navigate to the revisions tab of the node

The live revisions aren't listed inside the workspace.

Proposed resolution

Change the revision controllers and access checks such that live revisions are listed and can be reverted to from inside a workspace.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork wse-3490853

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

This is ready for a first review.

s_leu’s picture

Status: Needs review » Needs work

There revert button for the latest live revision isn't accessible inside workspaces and CI fails.

s_leu’s picture

Status: Needs work » Needs review

s_leu changed the visibility of the branch 3490853-revisions-of-nested-ws to hidden.

djdevin’s picture

I closed #3473693: Option to show all revisions on Workspace-enabled content in favor of this

Just wanted to note that it would be useful to show the Workspace the revision belongs to, which I think is happening in the MR!

s_leu’s picture

After discussing this with amateescu, the logic for altering the revert operation access results shouldn't live in an override of NodeAccessControlHandler because this will clash with what the Trash module is doing. Instead, the coresponding code in core needs to change, I filed an MR for this in #3440304: The default revision can not be reverted (to) when there are pending revisions.

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

amateescu changed the visibility of the branch 3490853-live-revisions-in-ws_2.0.0-alpha6 to hidden.

amateescu changed the visibility of the branch 3490853-live-revisions-in-ws to hidden.

amateescu’s picture

After giving this a lot of thought and trying various things, decided to go in a different direction than the latest MRs:

- stop filtering revisions -> all revisions are visible on the overview page regardless whether you're in a workspace or not
- add a Workspace table column (at the end)
- prevent revert and delete revision operations when an entity is tracked in a workspace and you're viewing the revision overview page from Live or a different workspace

  • amateescu committed 37fd4349 on 2.0.x
    Issue #3490853 by s_leu, amateescu: Allow viewing and reverting to live...

  • amateescu committed b8a4e8d3 on 1.0.x
    Issue #3490853 by s_leu, amateescu: Allow viewing and reverting to live...
amateescu’s picture

Status: Needs review » Fixed

Merged into 2.0.x and cherry-picked to 1.0.x, thanks for all the work here!

Status: Fixed » Closed (fixed)

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