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!

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

sdsc created an issue. See original summary.

sdsc’s picture

Project: Webform Content Creator » Webform
Version: 4.0.4 » 6.2.2

Just realized that this is an issue for Webform, not webform content creator, so I changed this issue to webform.

cilefen’s picture

Please provide the YAML of a minimal example form.

sdsc’s picture

this 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]'

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

A complete form with just the necessary fields would be more helpful.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

This seems to be related to using tokens but we are unable to replicate the issue

sdsc’s picture

Could 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?