Problem/Motivation
I use webform to update the existing node content. One field is checkboxes in webform and list field with multiple selections in content.
All other fields are updated successfully except the checkboxes. Both fields have the same value and text.
Steps to reproduce
If I choose the field name from the drop down directly, the node content will display as "array" but actually no selections were made; if I choose custom value of [webform_submission:values:attention], [webform_submission:values:attention:value] or [webform_submission:values:attention:checked:option_value], the node display will have the value text displayed, but actually no selection is made.
Once error message seems indicating some issues here:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '54892' for key 'PRIMARY': INSERT INTO "node" ("nid", "vid", "type", "uuid", "langcode") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 54892 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => visit [:db_insert_placeholder_3] => e274cdd7-0257-4dee-965e-fd44fd2ce3f7 [:db_insert_placeholder_4] => en )
Even if I only select one value, still the same error.
Did I configure this field wrong? Should I do it differently? Any advice?
Thank you in advance!
Comments
Comment #2
sdsc CreditAttribution: sdsc commentedJust realized that this is an issue for Webform, not webform content creator, so I changed this issue to webform.
Comment #3
cilefen CreditAttribution: cilefen commentedPlease provide the YAML of a minimal example form.
Comment #4
sdsc CreditAttribution: sdsc commentedthis is part of the field:
attention:
'#type': checkboxes
'#title': attention
'#title_display': invisible
'#options':
1: 'selection 1'
10: 'selection 10'
11: 'selection 11'
12: 'selection 12'
'#states':
visible:
':input[name="take_action"]':
value: '10'
'#default_value':
- '[webform_submission:source-entity:field_attention:value]'
Comment #5
cilefen CreditAttribution: cilefen commentedA complete form with just the necessary fields would be more helpful.
Comment #6
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commentedThis seems to be related to using tokens but we are unable to replicate the issue
Comment #7
sdsc CreditAttribution: sdsc commentedCould you advice:
1. what token should be for getting checkboxes' value (multiple value) from parent node's?
2. when updating or creating a node after the webform is submitted, directly using field mapping to pass multiple values' checkboxes doesn't work. what token should I use?