- Issue created by @weseze
We recently started activating a content_moderation workflow on a node with a webform reference field.
When translating these nodes we kept getting the error: 'Non-translatable fields can only be changed when updating the original language.'.
Turns out that the default values for "default_data", "open" and "close" are stored as NULL-values with the webform reference field, while the massageFormValues function interprets these as empty strings.
When Drupal core checks if non-translatable fields have been changed on the translation it detects that NULL is not equal to an empty string and gives an error...
It is worth noting that our webform reference field was set by custom code and we did not pass values for "default_data", "open" or "close". As soon as we started passing empty strings, things worked fine. We also had to update all existing field values from NULL-values to an empty string.
So, not sure if the same issue would occur when using standard webform reference field... (still need to dig further on that)
Still, seems like the default values (in field api + db storage) should be consistently either NULL or empty string.
Active
6.3
Code