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.
After submiting the form "The value you selected is not a valid choice." error appears.
Comment | File | Size | Author |
---|---|---|---|
#7 | the_value_you_selected-2694249-7.patch | 709 bytes | legolasbo |
Comments
Comment #2
snufkin CreditAttribution: snufkin at Acquia commentedThis is only an issue when the list is not text, but integer. I've done some work around trying to make it work with list_integer, managed to get the new value added to the allowed values, but still fails the validation for some reason.
We are not going to use the module, so i can't contribute more, but here is my work so far: https://gist.github.com/snufkin/4a317a1135883d27aee38e846ff2e542
Comment #3
tlyngej CreditAttribution: tlyngej at Annertech commentedI experienced an error like this, but on a field that didn't use `select_or_other`.
https://www.drupal.org/node/2698213#comment-11212523
Comment #4
robpowellI am receiving the same error message for all my select form elements even though I only use select_or_other on one field. If I uninstall the module, the errors do not show up.
Drupal version: 8.1.1 and select_or_other: 8.x-1.0-alpha2
Comment #5
legolasboI tried to reproduce the issue, but have been unable to do so. Could you please provide clear steps to reproduce it from a clean installation of Drupal and select or other?
Comment #6
tlyngej CreditAttribution: tlyngej at Annertech commentedSure.
On a site where you only have Drupal installed, using the "Standard" profile, and the "Select or Other" module:
admin/structure/types/manage/page/fields
and add a new "List (text)" field to the page content type where you set the allowed values to betest|TEST
test2|TEST2
admin/structure/types/manage/page/form-display
and set the first field you created widget to be "Select or Other"node/add/page
and try to select anything, but "- None -" in both or one of the select boxes and watch it fail submitting.admin/structure/types/manage/page/form-display
and select "Select list" instead of the "Select or Other" widget on the first field you createdSide-note: If you set the key and the value to be the same, in allowed values, the form will submit.
Comment #7
legolasboThe attached patch fixes the issue at hand. However I haven't been able to test if it doesn't introduce any problems with the addition of new values to select or other enabled fields. Please test the patch thoroughly if you can, so it can be committed swiftly.
Comment #8
tlyngej CreditAttribution: tlyngej at Annertech commentedI'll give it a spin.
Comment #9
tlyngej CreditAttribution: tlyngej at Annertech commentedI'm happy with it :-)
Tested that both the field, using the "Select or other" widget, and other fields are working, when this patch is applied to the module.
Comment #11
legolasboCommitted and pushed to 8.x-1.x, thanks!
Comment #13
gaurishankarpatch #7 working for me.
Thanks
Comment #14
frederickjhFor anyone else finding this is a Select or other bug. It was fixed this issue #2694249: "The value you selected is not a valid choice" error is thrown when using integer lists . It is in the dev version and the patch in this issue applies cleanly to the current version 8.x-1.0-alpha2 of Select or other.
Comment #15
kiliweb CreditAttribution: kiliweb commentedPatch #7 is working for me too.
If you are using "8.x-1.0-alpha2", consider switching to the "8.x-1.x-dev"
Thank you.
Comment #16
superlolo95 CreditAttribution: superlolo95 commentedI am using the dev version with workflow module.
Unforutnatelly this is not working.
What am I missing ?
thanks
Comment #17
gintass CreditAttribution: gintass commentedIn the alpha3 release notes this issue has been marked as fixed. It hasn't. I'm using this version 8.x-1.0-alpha3 on Drupal core 8.7.1 and the list fields with integer values still give me this error when I try to save the node - "The value you selected is not a valid choice"
Comment #18
Kris77 CreditAttribution: Kris77 commentedSame issue too...