Converts required, multiple “Select Options” with one option to Checkbox, causing array to string conversion errors

Created on 29 January 2025, 1 day ago

Problem/Motivation

During the migration of webform submissions from Drupal 7 to Drupal 10 using webform_migrate, an error occurs when migrating required "Select options" fields. These fields are incorrectly migrated as "Checkbox" with #multiple enabled, leading to array-to-string conversion warnings.

Array to string conversion WebformSubmissionStorage.php: 1352

Example export of the different component configs from the migration and two default checkbox and checkboxes.

Additionally, when you view the checkbox there is no way to have a title and checkbox label that I had in D7, though checkboxes type does allow for this presentation. Example of presentation:

Steps to reproduce

  • Use webform_migrate to migrate a Drupal 7 webform that contains a required single option "Select options" type component.
  • Observe that it gets migrated as a "Checkbox" type with d7_webform.
  • Run the d7_webform_submission migration and check logs.
  • See repeated warnings: Array to string conversion WebformSubmissionStorage.php:1352.

Proposed resolution

  • Instead of migrating to a "Checkbox" field type with multiple enabled, migrate the field to "Checkboxes" type.
  • Ensure that the #options array is properly handled.
🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇦Canada joelpittet Vancouver

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024