The following error happens when trying to create a translation for a content type where a color field is not translatable, and it has no default value.
Non-translatable fields can only be changed when updating the original language
In multilingual content type, with a non-translatable color field where no default color has been set, it is not possible to create a translation because the constraint EntityUntranslatableFieldsConstraintValidator fails when comparing opacity component of the original content with the new one. When comparing, the original value for opacity exists in the values array of the field, with NULL, but the opacity component in the values of the translation entity is not defined. Therefore, the validation fails making it impossible to translate content.
Curiosly, if a default color value is defined, the validation works well. So it would be nice if it was possible to define a default opacity, with no color default.
Another way to resolve this issue I've found is by adding the opacity component to the form, with #type value and #value set to NULL. This gives the correct NULL value for opacity when the validation is executed, and then it works and it is possible to save the translation.
I'll post a patch for this...
Comment | File | Size | Author |
---|---|---|---|
#2 | 3130614-2.patch | 514 bytes | markus_petrux |
Comments
Comment #2
markus_petrux CreditAttribution: markus_petrux commentedPatch attached.
Comment #4
NickDickinsonWildeThanks for the patch! Committed.