When validating whether or not a certain value of the CheckboxesOther element has been checked the element returns the wrong return value.

For example, create a form with 2 fields. One field should be a CheckboxesOther element with multiple values. The other field should be a *required* field which is only shown when a certain checkbox of the first field is checked. Now do *not* check the checkbox on which the condition is set and submit the form. You'll notice a required error message for the field which is not visible.

Attached patch fixes this issue, inspiration comes from the regular checkboxes element.

Comments

tjeerdb created an issue. See original summary.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new3.73 KB

I am not able to replicate this issue using the attached webform.

Please provide an example of the issue.

tjeerd@ibuildings.nl’s picture

StatusFileSize
new577 bytes

Please see the attached form

jrockowitz’s picture

StatusFileSize
new4.07 KB

I am unable to replicate this issue using the attached webform based the example from #3.

Are you able to replicate this issue using https://simplytest.me?

tjeerd@ibuildings.nl’s picture

StatusFileSize
new22.89 KB

Yes, please see attached screenshot.

To be sure: the problem is that after submitting a form with only the first checkbox checked, a message is shown that the still hidden field is required.

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.43 KB

I was able to replicate this issue. Attached is your patch re-created from the webform module's root instead of Drupal's root.

  • jrockowitz committed d8164e9 on 8.x-5.x
    Issue #2993324 by tjeerdb, jrockowitz: Retrieving corect value for...
jrockowitz’s picture

Status: Needs review » Fixed

Thanks for the patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.