Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296263

Views Rendered Entity field ignores the configured rendering language of the view display.

$
0
0

Problem/Motivation

When views are configured to display fields, and 'Rendered entity' is added as one of the fields, if an entity has any translations, for each view row that display that entity or its translation, the rendered entity displayed will ignore the 'Rendering language' configuration of the view display. A good example of such a view is the media_library view in the media_library module.

Steps to reproduce:

  1. On a multilingual site, configure a content type to be translatable.
  2. Create a node of that type.
  3. Add a translation of that node, and change the field values of the translation so differences are obvious.
  4. Create a content view.
  5. Configure the view to show fields.
  6. Add "Rendered entity" field
  7. Set the "Rendering Language" of the display to "Content language of view row".
  8. Preview the results, and observe that the node appears twice in the same language.

Proposed resolution

The view method of \Drupal\views\Plugin\views\field\RenderedEntity does not pass in a langcode to $view_builder->view(), so the entity is rendered per the site content language negotiation configuration.

Getting the langcode from the entity translation renderer and passing it into $view_builder->view() should provide the correct rendering language.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 296263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>