Problem/Motivation
When a field is contained in some sort of container entity, such as a field collection or a paragraph, and is rendered in the same form, i18n_field_field_widget_form_alter() will insert the instance information in the location where the field would need to be when it was directly in the node. The specific problem this was causing for me was that it was overwriting the instance information for the same field that was also directly contained in the node, but I can imagine this can have all sorts of interesting effects.
Proposed resolution
Set field instance information using the same functions as used in field_default_form(), i.e. field_form_get_state() and field_form_set_state().
Remaining tasks
- Write patch (already done, will attach as soon as I have an issue number)
- Review proposed resolution
- Write tests
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#6 | i18n-form_state_nested_fields-2685853-6-d7.patch | 1.04 KB | eelkeblok |
#3 | i18n-form_state_nested_fields-2685853-2-d7.patch | 1.05 KB | eelkeblok |
Comments
Comment #2
eelkeblokComment #3
eelkeblokAttached is a patch that resolves this problem for me.
Comment #4
idebr CreditAttribution: idebr at iO commentedComment #6
eelkeblokShame on me for not having notices turned on in dev. This should make the tests work again.
Comment #7
criscomThe patch in #6 fixed an issue with the paragraphs module for us where the AJAX handler failed for nested paragraphs fields.