Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The argument $form_state in the function i18n_field_field_widget_form() should be passed by reference and not by value.
function i18n_field_field_widget_form($form, $form_state, $field, $instance, $langcode, $items, $delta, $element) {
should be
function i18n_field_field_widget_form($form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
Passing by value discards all changes that the original 'module_field_widget_form()' (which i18n_field_field_widget_form() redirects through) makes to $form_state.
One direct impact is: #1156468: New translations don't inherit parent field collections (field_collection)
Patch follows
Comment | File | Size | Author |
---|---|---|---|
#1 | form_state-passed-by-value-1197866-1.patch | 819 bytes | jox |
Comments
Comment #1
jox CreditAttribution: jox commentedComment #2
Jerome F CreditAttribution: Jerome F commentedsubscribe
Comment #3
TommyChrisThe patch worked, thanks!
Comment #4
Jose Reyero CreditAttribution: Jose Reyero commentedFixed, thanks.
Comment #5
TommyChrisComment #6
TommyChris