checkboxes_other field with a '0' value option is buggy.

Created on 10 April 2023, over 1 year ago
Updated 25 May 2023, over 1 year ago

Problem/Motivation

A checkboxes_other field with the an option that has value 0 is buggy on that option.

  • When the '0' option is selected - this selection isn't saved and that option is always empty in the submission.
  • If the field is required, selecting the '0' option and submitting - triggers the required error.

Steps to reproduce

  1. Clean instalation of the latest Drupal 10 with 6.2.0-beta5 webform.
  2. Enable Webform module
  3. Create a new form with a checkboxes_other field:
    field_1:
      '#type': checkboxes_other
      '#title': 'Weekly timesframe'
      '#description': 'Weekly timeframe'
      '#title_display': before
      '#description_display': before
      '#options':
        - 'Up to 5 hours per week'
        - 'Up to 15 hours per week'
        - 'As needed (flexible)'
      '#other__option_label': Other
      '#other__placeholder': 'Enter other...'
    
  4. View the webform, select the first element and submit.
  5. Visit the result to see that the field is empty

It doesn't happen with checkboxes or radios.

🐛 Bug report
Status

Fixed

Version

6.1

Component

Code

Created by

🇫🇷France Yonka Nevache

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

Comments & Activities

Production build 0.71.5 2024