We have a multilingual webshop. Product variations are translatable and they have an untranslatable entity reference field (to product variations, basically "similar products" or "accessories"). When the product variation is rendered in one of the site's non-default languages, the entity reference gets rendered in the site's default language. This shouldn't be happening right? The whole product variation, including the entity reference field should get rendered in the selected language, right?

We shouldn't have to set the field as translatable, right? That's the use case if we wanted different references in different languages, but here we want the same references in all languages, but rendered in the current language. To me this looks exactly like the same bug in core which was fixed years ago: https://www.drupal.org/project/drupal/issues/2543258

Comments

teemuaro created an issue. See original summary.

mglaman’s picture

Issue tags: +Needs tests

We have test coverage for translation on the add to cart and the variations are rendered in their language. We'll need additional tests for this, I suppose.

bojanz’s picture

Status: Active » Closed (duplicate)

I think that the described problem was caused by this core issue: #2955392: EntityViewBuilder::viewField() does not respect entity current language when used with an entity reference field. Fix to be released in Drupal 8.8.0.