So far as I can tell "rendered item" property processor will just render the entity in the language of the user that is set to be viewing it (which is I assume is only intended for permissions).

Additionally, is the language that it is rendered in get sent with the property?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ekes created an issue. See original summary.

drunken monkey’s picture

Component: General code » Plugins
Status: Active » Needs review
FileSize
2.93 KB

No, from what I can see this should be fine. See the documentation for DatasourceInterface::viewItem(): the $langcode parameter already defaults to the language the item/entity has been loaded in – which, for us, is of course the item's language.
To make sure, I've also written a bit of test code, to ensure this works correctly, and that also came back fine – see the attached patch. We should of course add this, to make sure this keeps working in the future.

If you are certain this doesn't work correctly, please try to write a test that does fail.

ekes’s picture

I'll see if I can make a test - maybe _yet_ another thing for DDD? But what about when the fields have multiple languages?

Stepped through the test, and the indexing logic, and yes it will render as a separate item as best as possible the correct rendering of the fields per language as they exist.

ekes’s picture

Status: Needs review » Reviewed & tested by the community

  • drunken monkey committed b833c5a on 8.x-1.x
    Issue #2855444 by drunken monkey: Added language-specific test for the "...
drunken monkey’s picture

Good to hear, thanks for testing/reviewing!
Committed.

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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