Problem/Motivation

#2543258: Entity references of untranslatable fields are not displayed in the correct translation changes the viewElements() and getEntitiesToView() methods to have a second parameter called $langcode. The $langcode variable is used to determine the field's language context.
When that issue is fixed, we have to update the module's viewElements() and getEntitiesToView() methods as well.

Proposed resolution

Add the $langcode parameter and use it correctly when displaying fields.

Remaining tasks

Wait for core patch to be committed, review patch, commit.

User interface changes

None

API changes

None

Data model changes

None

Comments

LKS90 created an issue. See original summary.

LKS90’s picture

StatusFileSize
new2.92 KB

Might as well create a postponed issue and store the patch here :).

kataku’s picture

Status: Postponed » Active

Been reviewing this issue and i've written the exact same fix before finding this. I've commented on #2543258 to confirm their patch works there and I've used more or less the same fix posted here.

Why are this and the related issues postponed?

miro_dietiker’s picture

Status: Active » Postponed

Because they are postponed on the core issue. As soon as the core issue is committed, the fixes make sense. Before they don't.

berdir’s picture

Priority: Normal » Critical
Status: Postponed » Needs work

This has been committed now. The patch needs to be simplified, remove the fallback stuff, just pass $langcode along.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new2.87 KB

New patch. Added $langcode argument and changed EntityReferenceRevisionsFormatterBase to extend from EntityReferenceFormatterBase. Plenty of methods are identical, including the affected getEntitiesToView().

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Manually tested paragraph tests, they are finally green again with this!

miro_dietiker’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thx!

  • miro_dietiker committed 8076589 on 8.x-1.x authored by Berdir
    Issue #2551365 by LKS90, Berdir: Fix missing parameter for viewElements...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.