- Issue created by @michelle
- Status changed to Closed: duplicate
8 months ago 1:56pm 8 April 2024 - 🇷🇴Romania amateescu
This will be fixed in 🐛 Contraint validation error after merge: The content is being edited in the develop workspace Needs work .
- 🇺🇸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.
- Status changed to Active
7 months ago 4:12pm 11 April 2024 - 🇮🇳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
3 months ago 12:06pm 25 August 2024 - Status changed to Needs work
3 months ago 4:28pm 25 August 2024 - 🇺🇸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.
- Merge request !9409Issue #3438769 - Cleanup sub-workspaces on deploy to Live workspace → (Closed) created by vinmayiswamy
- Status changed to Needs review
3 months ago 10:37am 4 September 2024 - 🇮🇳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
3 months ago 4:27pm 5 September 2024 - 🇺🇸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.
- Status changed to Needs work
2 months ago 5:55pm 9 September 2024 - Status changed to Needs review
2 months ago 3:33pm 11 September 2024 - Status changed to RTBC
2 months ago 1:17pm 16 September 2024 - 🇬🇧United Kingdom catch
Thanks that looks better.
Committed/pushed to 11.x and cherry-picked back through to 10.3.x, thanks!
- Status changed to Fixed
2 months ago 7:58pm 16 September 2024 - Status changed to Needs work
2 months ago 9:19am 19 September 2024 - 🇩🇪Germany Antonnavi Berlin
Hello all,
The code:
if (!$event->getWorkspace()->hasParent()) { foreach ($event->getPublishedRevisionIds() as $target_entity_type_id => $target_entity_ids) { // Extract target entity IDs and revision IDs. $target_entity_ids_list = array_keys($target_entity_ids); $target_entity_revision_ids = array_keys($target_entity_ids); $this->deleteAssociations(NULL, $target_entity_type_id, $target_entity_ids_list, $target_entity_revision_ids); } }
which was committed to the core, there is a bug in this line:
$target_entity_ids_list = array_keys($target_entity_ids);
The
$target_entity_ids
variable is an array where keys - revision IDs and values - entity IDs. So instead of:$target_entity_ids_list = array_keys($target_entity_ids);
should be:
$target_entity_ids_list = array_values($target_entity_ids);
to get entity IDs instead of revisions.
- 🇬🇧United Kingdom catch
Thanks that's a good spot!
I've rolled this back from all four branches, let's re-add it with some additional test coverage.
- Merge request !9554Issue #3438769 - Workspace cleanup with test coverage for sub-workspaces. → (Closed) created by vinmayiswamy
- Status changed to Needs review
2 months ago 11:36am 20 September 2024 - 🇮🇳India vinmayiswamy
Thank you, @antonnavi, for highlighting the incorrect usage of
$target_entity_ids_list = array_keys($target_entity_ids);
.I’ve updated the code to use
$target_entity_ids_list = array_values($target_entity_ids);
, which correctly retrieves the entity IDs instead of revision IDs. Additionally, I've added test coverage to verify this change, ensuring that workspace associations are properly cleaned up when publishing the workspace.Kindly review the changes and please let me know if any further adjustments are needed. Your feedback and suggestions for improvements are greatly appreciated.
Thanks!
- 🇬🇧United Kingdom catch
In this context is array_values actually useful? i.e. do we need to replace the revision ID keys with indexed keys or does it not matter?
- 🇷🇴Romania amateescu
Reviewed the MR and fixed all my comments, sorry for taking so long to get to this folks.
- 🇬🇧United Kingdom catch
Committed/pushed to 11.x and cherry-picked back through to 10.3.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.