Problem/Motivation
I have a checkboxes field on webform. When form is submitted, I use handler to create a content, and the checkboxes field is mapped to list(text) on the content. After handled, the list (text) field on the content showing up as "Array", the log message recorded:
Warning: Array to string conversion in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::castValue() (line 2573 of /chroot/home/mysite/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php)
I tried:
1. only check one option on checkboxes field on the webform, not working;
2. multiple options checked, not working;
3. change the field to "select" on the webform, limited to on value, working!!
4. set the "select" field unlimited value, not working!
I believe this is a mature feature. There must be something I didn't do right. Appreciate any advice and help!
Comments
Comment #2
cilefen commentedCheckboxes are array data. What would a string representation be like?
Comment #3
sdsc commentedOr the question can be like:
1. what field type on webform can be mapped to list (text) with unlimited selections in node content?
2. what field type in node content can checkboxes on webform be mapped to?
Comment #4
jrockowitz commentedYou will have to debug the submission value and massage so that it can used to populate an entity.
You might be able to use or copy code from https://www.drupal.org/project/webform_content_creator