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

sdsc created an issue. See original summary.

cilefen’s picture

Category: Bug report » Support request

Checkboxes are array data. What would a string representation be like?

sdsc’s picture

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

jrockowitz’s picture

Version: 6.2.7 » 6.3.x-dev
Status: Active » Closed (outdated)
The Webform module's issue queue is for bugs, feature requests, and planning. Please post general support questions to Drupal Answers. You can also ask questions or help answer questions on the #webform channel on Drupal Slack.

You 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