Handler: Array to string conversion on Checkboxes Mapping

Created on 22 July 2024, 4 months ago
Updated 23 July 2024, 4 months ago

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!

💬 Support request
Status

Active

Version

6.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sdsc
  • Checkboxes are array data. What would a string representation be like?

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

Production build 0.71.5 2024