Respect language, cache metadata and revision id

Created on 6 March 2024, 9 months ago
Updated 23 May 2024, 6 months ago

Problem/Motivation

First of all, thank you for this nice module!

I notice 3 problems:

  1. When used with entity_reference_revision, it always displays the active revision, even when looking at a draft or another revision of the host entity.
  2. The language is not respected, see πŸ› Missing support for Entity Translations in FormatterBase.php Needs work .
  3. Cache metadata from the access check is not applied to the render element.

Steps to reproduce

Case 1: Revision support
On a website with paragraphs or another kind of "sub-entity", and content revision workflow.
A node type with paragraphs field, where the paragraphs are displayed with reference_table_formatter.
Edit a node with a paragraph.
Change some value in the paragraph.
Save as draft.
View the draft.

Expected: Forward revision of the paragraph is shown.
Actual: Active revision is shown (same as for published version of the content).

Case 2: Translation
See πŸ› Missing support for Entity Translations in FormatterBase.php Needs work

Case 3: Cacheability
I have not come up with a scenario yet :)

Proposed resolution

Apply change from πŸ› Missing support for Entity Translations in FormatterBase.php Needs work for translation support.

Use $items->referencedEntities() to support revisions.

Collect cache metadata from the access checks.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany donquixote

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024