Default value for WebformLikert webform element is not migrated properly

Created on 2 April 2021, about 4 years ago
Updated 8 March 2025, 28 days ago

Problem/Motivation

WebformLikert webform component always expects default value to be associative array, where keys are questions and values are answers. In D7 version, it's allowed to have default as a string this, which means that this answer should be default for all available questions.

1) Current migration does not support default value in array format;
2) Current migration does not handle transition D7 grid string value -> D8 WebformLikert array value;

Expected yml:

test_element:
  '#type': webform_likert
  '#questions':
    '1': 'Which one?'
  '#answers':
    '1': 'First'
    '2': 'Second'
  '#default_value': 
    1: '1'

Steps to reproduce

Migrate a webform with grid element and default value.

Proposed resolution

1) Add array support for default value;
2) Prepare default values for WebformLikert component;

Remaining tasks

1) Wait until πŸ“Œ Enable project testing, and add a kernel test and a source database and files fixture Needs review is landed;
2) Update the database fixture and tests;

πŸ› Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine Matroskeen πŸ‡ΊπŸ‡¦ Ukraine, Lutsk

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024