The EntityTranslatorTrait isn't returning non-translatable entities.

Created on 14 June 2023, over 1 year ago
Updated 20 January 2024, 8 months ago

We offer a handy EntityTranslatorTrait so you can translate entities anywhere.
You can pass a parameter (bool $strict = TRUE) to make sure the trait only returns entities that are in the target language.
If they aren't translated, the Trait doesn't return it back and either returns NULL or an empty array, depending on which method you used.

When the checked entity doesn't implement the TranslatableInterface, we ignore the $strict check.
However, we should also skip when ->isTranslatable() returns FALSE.
Right now, the entity is being discarded.

🐛 Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

🇧🇪Belgium Robin.Houtevelts

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024