Inconsistent paragraph translations containing untranslated entity_reference fields

Created on 4 October 2023, about 1 year ago

Problem/Motivation

I'm not exactly sure if this is a bug with paragraphs and translations but it is definitely unpractical.

See the steps below.
When a paragraph contains an (untranslated) entity reference field, we need to re-save ALL translations of the host entity in order for the corresponding translation of the referenced entity to show up, while I would expect EITHER to see the proper translation OR not to see the paragraph at all.
This looks really tedious, unpractical and misleading, especially when the website contains lots of languages (the website I'm working on has more than 30 languages).

Is this the expected behavior or an actual bug?
Here are some relevant places to break:
- EntityReferenceRevisionsEntityFormatter::viewElements inside $this->getEntitiesToView
- https://git.drupalcode.org/project/drupal/-/blob/10.1.x/core/lib/Drupal/...

Steps to reproduce

- Install drupal standard profile
- Enable paragraphs and content_translation
- At /admin/config/regional/language/add: add a language (e.g.: FR)
- At /admin/structure/paragraphs_type/add: create a new paragraph type (e.g.: List)
- At /admin/config/regional/content-language: enable translation for all nodes (article, basic page) and paragraph (list) types
- At /admin/structure/paragraphs_type/list/fields/add-field: create a node reference field (allow articles) - untranslated field
- At /admin/structure/types/manage/page/fields/add-field: create a paragraph field in basic page

- At /node/add/article: create an article (title "EN article") AND translate to FR
- At /node/add/page: create a basic page (title "EN page") AND translate to FR
- Now edit the basic page, add a a "list" paragraph, reference "EN article" and save
- View the "EN page" and notice we see "EN article"
- View the "FR page" and notice we see "EN article"
-> expected: EITHER to see the FR translation OR not to see the paragraph at all. It appears that the "List" paragraph only has an EN translation at this point and requires to be translated in order for the "FR article" translation to show up. So we need to go to all page node translations and click save.

- Edit the "FR page" and save -> now we see "FR article"

Proposed resolution

?

Remaining tasks

?

User interface changes

?

API changes

?

Data model changes

?

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium herved

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

Comments & Activities

Production build 0.71.5 2024