Problem with the webform reference field on a node with a worfklow enabled when adding/editing a translation

Created on 9 July 2025, 6 days ago

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.

🐛 Bug report
Status

Active

Version

6.3

Component

Code

Created by

🇧🇪Belgium weseze

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

Comments & Activities

Production build 0.71.5 2024