// include it in the cache ID.
if ($active_workspace =
$this->workspaceManager->
getActiveWorkspace()) { $parameters->conditions
['workspace'
] =
$active_workspace->
id();
} return parent::
loadTreeData($menu_name,
$parameters);
} /**
* {@inheritdoc}
*/
protected function loadLinks($menu_name, MenuTreeParameters
$parameters) { $links = parent::
loadLinks($menu_name,
$parameters);
// Replace the menu link plugin definitions with workspace-specific ones.
if ($active_workspace =
$this->workspaceManager->
getActiveWorkspace()) { $tracked_revisions =
$this->workspaceAssociation->
getTrackedEntities($active_workspace->
id());
if (isset($tracked_revisions['menu_link_content'
])) { /** @var \Drupal\menu_link_content\MenuLinkContentInterface[] $workspace_revisions */
$workspace_revisions =
$this->entityTypeManager->
getStorage('menu_link_content'
)->
loadMultipleRevisions(array_keys($tracked_revisions['menu_link_content'
]));
foreach ($workspace_revisions as $workspace_revision) { if (isset($links[$workspace_revision->
getPluginId()])) { $pending_plugin_definition =
$workspace_revision->
getPluginDefinition();
$links[$workspace_revision->
getPluginId()] =
[