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.
I have a content type which includes an image field and a separate entity reference field (drop down box) connected to a view. When I try to save, the entity reference field gives an error (illegal choice...contact site admin), but it works perfectly well when I don't upload an image. Any ideas?
Comments
Comment #1
ladybug_3777 CreditAttribution: ladybug_3777 commentedI have the same issue, but it occurs when I use a file field or an image field. I suspect this is somehow related to ajax events. If I select a file but don't press the "Upload button" it works fine. However if I do press "Upload" (Which fires and ajax event) I get the same error you see:
An illegal choice has been detected. Please contact the site administrator.
I've also noticed that removing a file or image (via the remove button, which also cause an ajax event) will throw this error.
Once the error has been thrown my drop down of entities is blank. If I cancel and go back to edit the content type my entities come back.
Comment #2
jemisond CreditAttribution: jemisond commentedAny fix or workaround for this?
Comment #3
tashaharrison80 CreditAttribution: tashaharrison80 commentedHaving the same issue - any ideas? I found this: https://www.drupal.org/node/1045208 but still no solution
Comment #4
ladybug_3777 CreditAttribution: ladybug_3777 commentedI am using the patch (#5) I wrote on this post: https://www.drupal.org/node/2358049
to fix the issue. The problem is related to Views and ajax. If it works for you please leave feed back on that page.
Comment #5
ladybug_3777 CreditAttribution: ladybug_3777 commentedFYI, anyone looking for more information on this issue may want to check out these posts as well. I found them while researching the issue:
https://www.drupal.org/node/2358049
https://www.drupal.org/node/1823506
https://www.drupal.org/node/2242773
https://www.drupal.org/node/1045208
Comment #6
tashaharrison80 CreditAttribution: tashaharrison80 commentedApplied the patch and it didn't work, but that is probably because I'm having the issue on an Entityform. Should have read it first before excitedly applying.
Comment #7
infinet CreditAttribution: infinet commentedHi tashaharrison80
Did you find a fix?
I have described a similar bug here... does that sound like yours?
https://www.drupal.org/node/2429173
Cheers
Scott
Comment #8
tashaharrison80 CreditAttribution: tashaharrison80 commentedHi infinet
No fix yet. I put this on the back burner for a couple of weeks and am just coming back to it today.
I think my issue to do with Views.
Comment #9
MustangGB CreditAttribution: MustangGB commented