Active
Project:
Category
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Sep 2006 at 19:34 UTC
Updated:
24 Jul 2018 at 16:28 UTC
Jump to comment: Most recent
I have just downloaded today the CVS version of Category module and the latest version of Drupal.
In trying to replicate the Container and Category setup of the Category Module demo site, I received the following error when trying to add a category to a container:
An illegal choice has been detected. Please contact the site administrator.
I had read previously that this bug had been reported and apaprently fixed?
Comments
Comment #1
nicholasthompsonI've found that a common cause of this is if a form posts to another form but doesn't clear its $edit details from the $_POST. Drupal then thinks you're editing the next form rather than moving onto a new one and sometimes cant fill in fields that dont exist.
This was a problem we had to get around for the Quiz module.
Comment #2
TheWhippinpost commentedI came across this problem when working with 2 browsers - IE and FF. I assumed it was a permissions or session-type issue.
Comment #3
liquidcms commentedi am just upgrading a site from 4.6 to 4.7 and i noticed this same error caused when i added the poormanscron and privatemsg modules into my setup.
Clearing the sessions table (and i also cleared the cache) seems to have fixed it.
peter....
Comment #4
karunadev commentedI receive this error, and a message in the log "Illegal choice in Parent element." when using the Internationalization module to add a translation of a category (book content as category).
Comment #5
raphael_kariuki commentedHi, I saw an answer that works on this link
http://drupal.org/node/153774
Comment #6
nightlife2008 commentedHi people,
I've been dealing with the same error on some client's websites. I've been able so solve it and wrote my solution down at: http://www.halecommunications.be/blog/?p=88
Hope I can be of any assistance!
greets,
Kim
Comment #7
jcmartinezBefore doing anything complicated, double check that there is an input format selected. I changed my default input format and for some reason no input format was selected by default in the form for entering new content. Since input format is probably collapsed, you may not see it.
I edited the content type and selected a couple of formats and the issue got fixed. Now when I create new content, there is one format selected by default and the submit of the page works great.
Hope it can save you some time.
Comment #8
jcmartinezSorry I changed the title of the issue unintentionally. Here is back.
Comment #9
scottybrookie commentedI got this message when trying to select certain departments in a list of checkboxes. Some departments worked, some generated the "illegal choice" message. The problem turned out to be that some departments' names had ampersands in them and others didn't. When I changed the ampersands to "and" that fixed it.
Before (generates error):
Art Department
Digital Arts & New Media
...
After (works):
Art Department
Digital Arts and New Media
...
Comment #10
zincdesign commentedSolved my issue - thanks scottyfb !
Comment #11
earwax commentedMy problem was that I was using conditional fields module. If you hide radio options with the conditional fields module and they are required, then they still have to be selected, even though the radio options are hidden.
Comment #12
pratip.ghosh commentedI know it might be a bit late to discuss this query again, but i am having the same problem. I'll give you my scenario, any help is really appreciated.
I have a dropdown created along with some other form elements using Drupal 7 form API as follows :
The javascript function "date_range_toggle" called from these dropdowns has the following content :
As noted this is an ajax function calling a page "populate_fields". Now i show you the content written in the .module file :
In menu hook :
In theme hook :
... And finally the .inc file :
Now, when the ajax is fired, it works perfectly, but when I submit the form, it shows the error : an illegal choice has been detected. please contact the site administrator
Please help someone...
Comment #13
nodeAche commentedI had that message showing on my form while trying to upload an image.
I got my issue resolved by giving a default value to my forms required fields.
Comment #14
phponwebsites commentedI'm also getting this error when trying to upload images using media browser on particular datatypes.
Comment #15
mdjamiruddin commentedI have faced the issue - "An illegal choice has been detected. Please contact the site administrator." for a select field while saving the form data after uploading image through Drupal ajax for an image field.
The options for the select field is being populated through the result set of a custom MySQL query having a condition by a dynamic variable through Drupal form alter. As Drupal reload the entire form through ajax callback, after uploading image through ajax, the value for the dynamic variable was not being maintained at this time and mismatched the option value.
To solve this type of issue, I have passed the required variable value in the form as hidden field to use it next time from $form_state variable in Drupal form alter. Please try this type of approach.
Comment #16
cristian100I've just experienced this issue with Drupal 8.5.4 version when I was trying to modify the text format "Basic html", no matter what I do, if I went there and simply save I get the message "An illegal choice has been detected. Please contact the site administrator.".
Comment #17
kris77 commented@mdjamiruddin Can you explain me better please?
I have two fields in my content:
So, if save the node without populating the select field, it's all ok. Then I can edit the node and populate the select field without error.
Otherwise, if populate the select field and load an image, I fave the issue: "An illegal choice has been detected. Please contact the site administrator."
Thanks.