fix: #3616230 Entities trashed in a workspace are still loaded from the persistent entity cache

TrashStorageTrait::buildQuery() filters soft-deleted revisions, but the persistent entity cache answers before any query is built. Workspaces keeps tracked IDs out of that cache by claiming them in hook_entity_preload(); Trash filters the soft-deleted revision out of the loadMultipleRevisions() call preload makes, so the ID is never claimed and cache.entity returns the Live default revision, which is neither deleted nor unpublished.

Override getFromPersistentCache() to skip the cache for IDs tracked in the active workspace and resolve them through the storage query instead.

The workspace tracker lookup falls back to the 'workspace_association' service for core versions before 11.3.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com

Closes #3616230

Merge request reports

Loading