Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#2 | 2855444-2--add_rendered_item_translations_test.patch | 2.93 KB | drunken monkey |
|
Comments
Comment #2
drunken monkeyNo, 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.
Comment #3
ekes CreditAttribution: ekes as a volunteer commentedI'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.
Comment #4
ekes CreditAttribution: ekes as a volunteer commentedComment #6
drunken monkeyGood to hear, thanks for testing/reviewing!
Committed.
Comment #7
drunken monkey