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 byWorkspaceTracker::loadAssociatedRevisions(). - Entity queries:
workspaces.entity.query.sqldecorates the SQL query factory. - Views:
hook_views_query_alter()joins the workspace association table for each supported entity type in the query. - Path aliases:
WorkspacesAliasRepositorychanges the alias base query. - Menus:
WorkspacesMenuTreeStoragereplacesmenu.tree_storage. - Render caching: the
workspacecache 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
Comments