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.
Adding an address composite to a webform and choosing the state element to be of textfield, still throws out the "An illegal choice has been detected. Please contact the site administrator." error.
Comment | File | Size | Author |
---|---|---|---|
#2 | webform-prevent_illegal_error_composite-2893622-2.patch | 768 bytes | hanoii |
|
Comments
Comment #2
hanoiiI tracked this down to the fact that if an element has both '#options' and '#value' drupal attempts to validate the same way (
performRequiredValidation()
).An odd thing about this is that this didn't happen before, only on my latest batch of updates (webform-beta12 to beta 15 and core 8.3.4 to 8.3.5) so not sure if the root of this is a change in core or something else.
Anyhow, attach is a patch that sorts this out by removing '#options' on textfields. Not sure if you'll like this approach but so I couldn't think of a better way of fixing this.
On the other hand, I don't think it's a harmful patch either.
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThanks for the patch