Problem/Motivation

When a workspace is active, Workspaces changes several runtime paths:

  • Entity loads: hook_entity_preload() swaps in the workspace revision, using the associations loaded by WorkspaceTracker::loadAssociatedRevisions().
  • Entity queries: workspaces.entity.query.sql decorates the SQL query factory.
  • Views: hook_views_query_alter() joins the workspace association table for each supported entity type in the query.
  • Path aliases: WorkspacesAliasRepository changes the alias base query.
  • Menus: WorkspacesMenuTreeStorage replaces menu.tree_storage.
  • Render caching: the workspace cache context varies cache entries per workspace.
  • Saves write to the association tables, and publishing loads and saves every tracked entity.

We should have Performance tests to cover some (or all) of this. The module also runs code on Live, with no active workspace. It adds a request subscriber, the workspace negotiators, the entity query decorator and the alias and menu storage overrides. A request in a site that has Workspaces installed but doesn't have an active workspace should cost the same as one without the module.

Steps to reproduce

N/A

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

amateescu created an issue.