Add ability to revert to revisions, regardless of workspace

Created on 21 May 2025, 17 days ago

Problem/Motivation

I am unable to revert to revisions in a workspace that does not have the most recent revision. It may seem a bit silly to revert to a revision that is still in a workspace, especially from a workflow standpoint, and I don't necessarily care to either. However, my sense is that this is something that the core workspaces module prevents to avoid confusion. Since with this module, I can continue editing my content live while it is also in a workspace, I think I should also still be able to revert that content to previous revisions, especially since reverting is non-destructive and only creates a new copy of that previous revision.

Proposed resolution

Allow reversions to occur, even when that content has been edited in a parallel workspace. When assigning the new revision created from a reversion to a new workspace, just assign it to the current one.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @MegaKeegMan
  • πŸ‡ΊπŸ‡ΈUnited States djdevin Philadelphia

    I thought this was already happening, where whatever revision is reverted, that just gets copied to the latest revision in the current workspace.

    Does it give you an error?

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan
  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    Currently I have edited content in a workspace called "Stage". I am able to revert to previous revisions while I am in "Stage". But say I switch to live and made edits in liveβ€”I am not able to revert to previous revisions while I am in live. I can do a little bit more testing to try and understand more precisely how it behaves.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    Okay. So the moment content gets added to a workspace, you can only revert to revisions of that content while in that workspace. If you edit it again on live, you cannot revert to a revision. If you edit in another workspace, you will not be able to revert while in that workspace either. There is no error. Simply the "revert" buttons are missing while view the revision history. They are only present in the first workspace where the content editing occurred.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    One potential UX issue that may arise out of this change (which is a typical issue with workspaces) is just helpful contextual clues or maybe just more warnings when trying to revert, and a reminder about which workspace you are actually in and which workspace the reversion will belong to. Just a consideration, but probably not required for completion.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    Here is an example of what I see when I am looking at revisions from the default workspace (no revert button)

  • πŸ‡ΊπŸ‡ΈUnited States djdevin Philadelphia

    Ah, are you using Workspaces Extra? That module provides a custom controller for the revision history that removes the operations button.

    So I don't think this is an issue with Parallel workspaces but probably an issue for that project to allow revisions to be reverted.

    Our team does this for a few edge cases so I know it's a feasible workflow.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    Thank you for the info. I'll take a look to confirm what you are saying later today, and then move this issue to the correct project. I had assumed that this was something that core prevented intentionally, and that this module should work around it. A reasonable assumption, but good to know that it is not true.

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan
  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan

    Okay, will make an issue fork at some point, but I found I was able to get the revert buttons to show up by removing the 'revert' and 'revert revision' items from the array on line 441 of wse.module in the wse_entity_access hook. For reference, this code was added in https://www.drupal.org/project/wse/issues/3490853 πŸ“Œ Allow viewing and reverting to live revisions inside workspaces Active

    Is this or a similar change something that would be considered for merge?

  • πŸ‡ΊπŸ‡ΈUnited States MegaKeegMan
Production build 0.71.5 2024