Unselected radio yields array data-structure as value.

Created on 18 June 2018, almost 7 years ago
Updated 24 April 2025, about 1 month ago

Steps to reproduce

  1. Navigate to a form with a non-required select_or_other element rendered as radios and the default value NULL (default).
  2. Submit the form without interacting with the select_or_other element.
  3. Look at the submitted value (use dpm() or look at where the data was stored).

Expected behaviour

The value for the select_or_other is NULL.

Actual behaviour

An array is stored: ['select' => NULL, 'other' => '']. The values are left untouched by select_or_other_element_validate(). This leads to various warnings and misbehaviours in modules that don’t expect select_or_other to return an array as value.

Proposed solution

select_or_other_element_validate() should always hide the internal data-structure.

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria torotil

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

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