Sub workspace does not clear

Created on 4 April 2024, 5 months ago
Updated 5 September 2024, 2 days ago

Problem/Motivation

When changes are made in a sub-workspace and pushed to the live workspace, the sub-workspace does not clear old changes as expected. This is due to the WorkspaceAssociation::onPostPublish() method not deleting the associations of sub-workspaces when published to the live workspace. The issue persists as old changes continue to appear after merging and publishing.

Steps to reproduce

1. Set up Drupal with the Workspaces module enabled.
2. Create a parent workspace and multiple sub-workspaces.
3. Make changes in a sub-workspace.
4. Merge the sub-workspace changes into the Stage workspace.
5. Publish changes from the Stage workspace to the Live workspace.
6. Verify that the sub-workspace has been cleared and old changes are no longer present.

Proposed resolution

To resolve this issue, we need to implement a cleanup logic to ensure that the associations between sub-workspaces and their changes are properly removed when changes are published to the live workspace. This will prevent old changes from persisting and ensure that the workspace accurately reflects the latest changes.

🐛 Bug report
Status

RTBC

Version

11.0 🔥

Component
Workspaces 

Last updated 1 day ago

No maintainer
Created by

🇺🇸United States Michelle Wisconsin, USA

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

Merge Requests

Comments & Activities

  • Issue created by @Michelle
  • Status changed to Closed: duplicate 5 months ago
  • 🇺🇸United States Michelle Wisconsin, USA

    @amateescu,

    Thanks for finding that. I did search quite a bit before filing these issues but I guess I just wasn't using the right terms. I was calling it "sub workspace" not "develop workspace". If I hit any more problems, I'll search on that.

  • 🇺🇸United States DamienMcKenna NH, USA
  • Status changed to Active 5 months ago
  • 🇷🇴Romania amateescu

    Turns out I was wrong in #2, the problem here is WorkspaceAssociation::onPostPublish() not deleting the associations of sub-workpaces.

  • 🇺🇸United States DamienMcKenna NH, USA
  • 🇺🇸United States Erik_MC

    Bumping for visibility.

  • 🇮🇳India amitvin

    As the workspace association is not getting deleted, One is not able to edit the content on the live workspace even if the content is published. Right now getting the message that content can not be edited as the content is edited in the sub workspace.
    A temporary workaround is to delete the association manually after merging the sub-workspace with the parent workspace.

  • 🇩🇪Germany Antonnavi Berlin

    Hello all here,

    I had the same bug and fixed it in the way of adding additional cleanup on publication to Live workspace.
    See details in attached patch file.

  • Status changed to Needs review 14 days ago
  • Status changed to Needs work 13 days ago
  • 🇺🇸United States smustgrave

    Hello, all fixes should be in MRs against 11.x so tests will run.

    Also issue summary should be complete and a clear title. Tagging for both.

    With most bugs will also need a test case showing the issue

  • First commit to issue fork.
  • Pipeline finished with Failed
    4 days ago
    Total: 428s
    #273241
  • Pipeline finished with Success
    4 days ago
    Total: 367s
    #273336
  • Status changed to Needs review 4 days ago
  • 🇮🇳India VinmayiSwamy

    Hi, I have created an MR incorporating the patch changes from comment #9 and added a test case to validate these changes as outlined in comment #11. The issue summary has been updated accordingly.

    I am removing the "Needs issue summary update" and "Needs tests" tags. If anyone believes these tags should still be applied, please feel free to re-add them.

    Kindly review the changes and let me know if any further adjustments or updates are needed. Your feedback and suggestions for further improvements are greatly appreciated.

    Thanks!

  • Status changed to RTBC 2 days ago
  • 🇺🇸United States Scott Weston

    Reviewed code of #13 (and #9) and tested on Drupal 11.0.1 clean Standard installation with default and custom content types, taxonomy terms, and menu links. The bug experienced is no longer happening. Updating status to RTBC.

Production build 0.71.5 2024