Skip to content
Snippets Groups Projects
Commit b5def768 authored by catch's avatar catch
Browse files

Issue #3438769 by vinmayiswamy, amateescu, catch, antonnavi, michelle: Sub workspace does not clear

(cherry picked from commit 2cfb0738)
parent 0d81ddd1
No related branches found
Tags 8.x-1.0-alpha2
9 merge requests!10663Issue #3495778: Update phpdoc in FileSaveHtaccessLoggingTest,!10451Issue #3472458 by watergate, smustgrave: CKEditor 5 show blocks label is not translated,!103032838547 Fix punctuation rules for inline label suffix colon with CSS only,!10150Issue #3467294 by quietone, nod_, smustgrave, catch, longwave: Change string...,!10130Resolve #3480321 "Second level menu",!9936Issue #3483087: Check the module:// prefix in the translation server path and replace it with the actual module path,!9933Issue #3394728 by ankondrat4: Undefined array key "#prefix" and deprecated function: explode() in Drupal\file\Element\ManagedFile::uploadAjaxCallback(),!9914Issue #3451136 by quietone, gapple, ghost of drupal past: Improve...,!9882Draft: Issue #3481777 In bulk_form ensure the triggering element is the bulk_form button
Pipeline #311752 passed
......@@ -391,7 +391,12 @@ public static function getSubscribedEvents(): array {
* The workspace publish event.
*/
public function onPostPublish(WorkspacePublishEvent $event): void {
$this->deleteAssociations($event->getWorkspace()->id());
// Cleanup associations for the published workspace as well as its
// descendants.
$affected_workspaces = $this->workspaceRepository->getDescendantsAndSelf($event->getWorkspace()->id());
foreach ($affected_workspaces as $workspace_id) {
$this->deleteAssociations($workspace_id);
}
}
}
......@@ -156,6 +156,14 @@ public function testWorkspaceAssociation(): void {
$expected_initial_revisions['dev'] = [8];
$this->assertWorkspaceAssociations('node', $expected_latest_revisions, $expected_all_revisions, $expected_initial_revisions);
// Publish 'stage' and check the workspace associations.
/** @var \Drupal\workspaces\WorkspacePublisherInterface $workspace_publisher */
$workspace_publisher = \Drupal::service('workspaces.operation_factory')->getPublisher($this->workspaces['stage']);
$workspace_publisher->publish();
$expected_revisions['stage'] = $expected_revisions['dev'] = [];
$this->assertWorkspaceAssociations('node', $expected_revisions, $expected_revisions, $expected_revisions);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment