The tenant task list says "Unassigned" in English on every site, from a view setting that cannot be translated

Closes https://www.drupal.org/project/orchestra/issues/3625257

The manager's tenant task list showed Unassigned, in English on every site, for a task nobody holds yet. It was the Assignee column's "No results text" in the shipped views.view.orchestra_inbox, and core types that setting as a plain string, so it is never translated.

Four commits:

  1. HolderLabelTrait (orchestra_views) takes the Held by column's page preparation and rendering, moved unchanged: the page's assignees loaded and its pools named in one pass each, the viewer's cacheability and the named roles' and accounts' tags on the render (prepareHolderLabels()), and the label escaped once (renderHolderLabel()). WorkItemHolder now uses it.

  2. The Assignee column uses the same trait: an assigned task still shows the linked username, and a pooled one says who it is offered to (Offered to: … or (anyone)), in the Held by wording. It keeps its base's user-list tags and max-age explicitly (insteadof) and adds the user context the wording needs. The shipped view drops its untranslatable empty text. The views help texts, their French, and docs/views.md are corrected: neither column ever showed "an explicit unassigned marker".

  3. Found in the audit of this MR: the viewer partition is applied only where it is read. The holder wording consults the viewer only for a pooled row with an audience (whose cover reached them), yet the columns added the viewer's delegation tags and cover max-age to every render, and both declared user at handler level, which is frozen into the view: a page listing only assigned tasks was split per user and dropped whenever any delegation changed. prepareHolderLabels() now applies the viewer's cacheability only when the page has such a row, and neither column declares user itself any more. The shipped lists' exported metadata is unchanged (they vary per user through other columns); a site's own view carrying one of these columns is no longer split per user for nothing.

  4. AssignmentMatcher::mergeCacheableMetadata(array &$build, AccountInterface $account) now merges an account's cacheability into a render array (what AssignmentCacheTrait::applyAssignmentCacheability() did, which now calls it). HolderLabelTrait calls the matcher directly and needs no cache trait, so Assignee inherits its base's tags, max-age and contexts unchanged, with no insteadof block. Named merge, not apply, because core's CacheableMetadata::applyTo() replaces a build's cache data, and this keeps it.

Tests: TenantTasksViewTest::testTheAssigneeColumnVariesByViewerOnlyForPooledTasks checks both directions (fails on the previous head, where an assigned-only page depended on the viewer, and on a mutation that never applies it).

Test: TenantTasksViewTest::testTheAssigneeColumnNamesThePoolOfAnUnassignedTask pools a task between two users and expects the cell to read the holder wording. On 1.x it reads Unassigned.

AI-Generated: Yes (Claude Code found this on a French site after deploying the previous fixes and wrote the change and its test.)

Edited by Frank Mably

Merge request reports

Loading
Loading