Skip to content
Snippets Groups Projects
Commit b4fdd3fe 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 dee8d883
No related branches found
No related tags found
2 merge requests!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...
Pipeline #311134 passed with warnings
+7
......@@ -439,7 +439,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