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
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 commentedThis is ready for a first review.
Comment #4
s_leu commentedThere revert button for the latest live revision isn't accessible inside workspaces and CI fails.
Comment #5
s_leu commentedComment #7
djdevinI 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!
Comment #8
s_leu commentedAfter discussing this with amateescu, the logic for altering the revert operation access results shouldn't live in an override of
NodeAccessControlHandlerbecause 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.Comment #14
amateescu commentedAfter 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
Workspacetable 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
Comment #17
amateescu commentedMerged into 2.0.x and cherry-picked to 1.0.x, thanks for all the work here!