-
Notifications
You must be signed in to change notification settings - Fork 14
Description
It's great we can use the CanFieldBeTranslatedCheckEvent to change if a field can be translated. The problem though is that the event doesn't know anything about the field's value.
For example: we use a custom renderType for previewing SERPs for fields like seo_title or description which leads to dd_deepl not to translate the description field of pages. So we created an event, which enables this. Of course we could have used translateWithDeepl in this case, but this is not always applicable.
So as we use the event, we force the translation for all description fields, even for pages of type 'folder'. But the description there is null which leads to an error, as DeeplTranslationService->translateFieldInternal expects a string for $fieldValue.
I would suggest to add the fieldValue to the event (and maybe some information why the result has the value it has?) or make some sanity checks so that even if overridden by an event no empty/null values are passed.