Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This scenario is fairly unique, but maybe others have encountered it.
I have a multi-page form.
On page 1:
- Radio element, options are "A" and "B"
- Radios other element (conditionally visible when B is selected in the first element).
I select B, then select Other and enter text in the other field.
I click to the next page.
I click previous to return to page 1.
When I switch from "B" to "A" and click next, I am given the following error:
"An illegal choice has been detected. Please contact the site administrator."
Comment | File | Size | Author |
---|---|---|---|
#9 | webform.webform.temp_.yml | 5.32 KB | jrockowitz |
#9 | 3210047-9.patch | 1.36 KB | jrockowitz |
| |||
#8 | 3210047-8.mov | 1022.53 KB | dshields |
#6 | 3210047.mov | 1.23 MB | dshields |
#5 | webform.webform.temp_.yml | 5.14 KB | dshields |
Comments
Comment #2
dshields CreditAttribution: dshields commentedThis seems to get around it, but I'm sure there's a better approach
Comment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedCan you please create an example webform that can be used to replicate this issue?
Comment #5
dshields CreditAttribution: dshields commentedYup.
I'll try to attach a demo video as well.
Comment #6
dshields CreditAttribution: dshields commentedHere's a video demo of the issue.
Thanks for looking at this!
Comment #7
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedDo you mind checking if you can replicate this issue using the Bartik theme? I am guessing your theme is causing the issue.
Comment #8
dshields CreditAttribution: dshields commentedI'm afraid I get the very same in Bartik.
Comment #9
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThis is a very edge case bug. The attached patch fixes the issue via \Drupal\webform\Element\WebformRadiosOther::valueCallback and tries to document exactly what needs to be fixed.
I am not exactly sure how to write test coverage for this issue but let's first confirm all the tests are still passing.
I have also included an updated test form that debugs what values are being submitted via to the submission.
Comment #10
dshields CreditAttribution: dshields commentedWorks well for me!
Comment #13
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedPlease consider joining the Webform module's Open Collective to help ensure that the Webform module is maintained.
Comment #14
jrockowitz CreditAttribution: jrockowitz as a volunteer and at Webform module Open Collective, The Big Blue House commented