SHS does not work in embedded field collections, because it looks for field value in hard coded location. Actual field values may be deeper in $form_state.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | use_parents-1968308-6.patch | 2.41 KB | henrijs.seso |
| #5 | use_parents-1968308-5.patch | 2.41 KB | henrijs.seso |
| #4 | 1.patch | 1.53 KB | CSoft |
| #1 | use_parents_for_default-1968308.patch | 881 bytes | henrijs.seso |
Comments
Comment #1
henrijs.seso commentedHere is patch. Instead of relaying on field value to be found always in same place, patch uses #parents array to go directly to correct field correct value. This makes SHS work in field collections and will probably fix other issues along the way.
Comment #2
CSoft commentedAlso validation function shs_field_widget_validate does not work correctly with field collections.
I suggest the following solution:
Comment #3
henrijs.seso commented@CSoft What did not work in validation? I ask to re-roll patch with your changes and to see what to test.
Comment #4
CSoft commentedI'm using SHS within the module inline entity form, which is inside the field collections. In this case, the validation function shs_field_widget_validate does not work correctly. My code above solves this problem.
The patch is attached.
Comment #5
henrijs.seso commentedUploading combined patch from both previous patches.
Comment #6
henrijs.seso commentedUploading correct combined patch from both previous patches.
Comment #7
stborchertWow, thanks for your patches.
I have committed the patch and some additional changes so Simple hierarchical select works in field collections and in inline entity forms.
Comment #8
stborchertComment #10
scott.whittaker commentedJust a quick update to note that this was committed to the dev branch over a year ago, but has not made it to the stable branch yet. Dev branch seems to be working for me so far. Any idea when stable will be updated?