I have not tested this issue on clean install, when exposed drop-down filter is created for first time, it seems that there is no default value assigned to it, although it is displayed in drop-down list on the view page.

Workaround:
- Check "remember last setting" & save
- Go to the page page, select value you want to be default and apply it
- Uncheck "remember last setting" & save

CommentFileSizeAuthor
#12 ANGST1.png61.8 KBdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Component: exposed filters » taxonomy data
Status: Active » Postponed (maintainer needs more info)
Issue tags: -taxonomy, -views, -exposed filter, -default value

Can you give us a some words about how to reproduce the problem?

This is probably required to fix the issue itself.

Your guess could be true. So the issue might be that a non existant default value is set.

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)
marktheshark’s picture

Confirming that this is an issue.

Created view with 2 exposed taxonomy term filters.

Every load of the view shows the error message mentioned above and select list for affected filter is marked red for default value "All"

DB log mentions "Illegal choice in tid_1 element."

Accidentally overcame the issue after making multiple values selectable for first exposed taxonomy filter. Don't know why this would have anything to do with it though...

marktheshark’s picture

Status: Closed (cannot reproduce) » Active

Marking as active, reproduced with first view created in drupal 7. Using views 3 rc1.

anieves’s picture

You (may be) can reproduce this if any of other view share the same exposed temr filter, and in any of these views not match the same config in 'depth' section, for example in view1 you put an term exposed form with config 'depth' set to 1, and in view2 you put the same term exposed form with config 'depth' set to 3, if you use this form exposed in any of the two views you got a famous 'Ilegal option... bla bla bla' because the term form exposed must be the same 'depth' config in two views.

I has this issue in my views exposed terms with diferents content types and with this solution the issue was fixed (Drupal 6 with views 6.x-2.12).

Please reply with some information about this.

Thanks.

jocken’s picture

This is actually not only for terms, all throws errors. How to reproduce:

Create a content type. Add a select-field to the type.

Create a node with the content type and choose an option in the select field.

Create a view and add a filter. Content -> Your field and expose it and click select all over options that can be chosen.

Now Illegal Choice Will Appear.

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

@jocken
Can you please try to check whether the current dev already fixes the problem?
There were quite some fix related to this topic.

jocken’s picture

@dereine
That fixed it!

Before you could just check "Limit list to selected items" to get away the error. But I tried to turn it off with the dev version and it doesn't throw errors. Awesome!

dawehner’s picture

Status: Postponed (maintainer needs more info) » Fixed

Update status.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

NetBUG’s picture

Version: 7.x-3.0-beta3 » 7.x-3.3
Component: taxonomy data » Code
Priority: Normal » Major
Status: Closed (fixed) » Needs review

Hello, I get the same problem.
I've got a Calendar view, and I'd like to filter events by two fields.
I get the same error on lirst load (when no search criteria were specified).
After I do any choice, the error disappears.
I mentioned that after any choice the URL is not mysite.com/schedule/day, but mysite.com/schedule/day?style=All&teacher=All.

Well, but what's about the default value? I looked through system errors and saw multiple errors about this default value: "Illegal choice all in teacher element".

Views verion is 7.x-3.3, Calendar - both last stable and 7.x-3.0+8-dev.

I tried to look through the code for this default 'all' value, but I couldn't fix it on my knee.

The problem can be exemplified by the site http://dance.gaenkov.ru/schedule/week/?style=All (sorry for Russian, as you see, the second parameter, 'teacher', is omitted in URL.)

dawehner’s picture

Status: Needs review » Active
FileSize
61.8 KB

Needs review means that there is an actual patch in queue.

Well all seems to exist on this page, so it's probably not about the exposed filter but about the calendar.

bmiller146’s picture

Version: 7.x-3.3 » 6.x-3.0

I'm seeing the same results for an exposed taxonomy based on tags. Since tags will always be added by the users, I cannot "limit to items" in the list as a workaround. I played around with adding the same exposed taxonomy field more than once (using the taxonomy term with depth field) and somehow got the original taxonomy tag exposed field to work. I was able to delete the extra exposed taxonomy with depth field and the original taxonomy field continued to work. I have two displays in the same view which are similar and experience the error. I was able to fix one of them, do an export, and compare the differences. I wasn't able to recreate the fix on the second view, so I deleted it and cloned the first.

The view export line items contained in the display without error:
/* Filter: Taxonomy Tag */...
Did not contain: $handler->display->display_options['filters']['tid_1']['value'] = '';
Did contain: $handler->display->display_options['filters']['tid_1']['expose']['reduce'] = 0;

Full versions of the views export for the 2 displays, one show the error, the other had the fix. The 'Filter: Taxonomy Tag' is the exposed field that triggers the error.

Working:

/* Display: Showcase Projects */
$handler = $view->new_display('page', 'Showcase Projects', 'showcase');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Showcase Stories of Impact';
$handler->display->display_options['defaults']['header'] = FALSE;
/* Header: Global: Text area */
$handler->display->display_options['header']['area']['id'] = 'area';
$handler->display->display_options['header']['area']['table'] = 'views';
$handler->display->display_options['header']['area']['field'] = 'area';
$handler->display->display_options['header']['area']['empty'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter: Node: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'project' => 'project',
);
/* Filter: Search: Search Terms */
$handler->display->display_options['filters']['keys']['id'] = 'keys';
$handler->display->display_options['filters']['keys']['table'] = 'search_index';
$handler->display->display_options['filters']['keys']['field'] = 'keys';
$handler->display->display_options['filters']['keys']['exposed'] = TRUE;
$handler->display->display_options['filters']['keys']['expose']['operator'] = 'keys_op';
$handler->display->display_options['filters']['keys']['expose']['limit_operators'] = array();
$handler->display->display_options['filters']['keys']['expose']['label'] = 'Keyword:';
$handler->display->display_options['filters']['keys']['expose']['identifier'] = 'keyword';
$handler->display->display_options['filters']['keys']['expose']['single'] = TRUE;
/* Filter: Taxonomy Category */
$handler->display->display_options['filters']['tid']['id'] = 'tid';
$handler->display->display_options['filters']['tid']['table'] = 'term_node';
$handler->display->display_options['filters']['tid']['field'] = 'tid';
$handler->display->display_options['filters']['tid']['ui_name'] = 'Taxonomy Category';
$handler->display->display_options['filters']['tid']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid']['expose']['operator'] = 'tid_op';
$handler->display->display_options['filters']['tid']['expose']['limit_operators'] = array();
$handler->display->display_options['filters']['tid']['expose']['label'] = 'Category';
$handler->display->display_options['filters']['tid']['expose']['identifier'] = 'category';
$handler->display->display_options['filters']['tid']['expose']['reduce'] = 0;
$handler->display->display_options['filters']['tid']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['tid']['type'] = 'select';
$handler->display->display_options['filters']['tid']['vid'] = '2';
$handler->display->display_options['filters']['tid']['error_message'] = 0;
/* Filter: Taxonomy Country */
$handler->display->display_options['filters']['tid_2']['id'] = 'tid_2';
$handler->display->display_options['filters']['tid_2']['table'] = 'term_node';
$handler->display->display_options['filters']['tid_2']['field'] = 'tid';
$handler->display->display_options['filters']['tid_2']['ui_name'] = 'Taxonomy Country';
$handler->display->display_options['filters']['tid_2']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid_2']['expose']['operator'] = 'tid_2_op';
$handler->display->display_options['filters']['tid_2']['expose']['limit_operators'] = array();
$handler->display->display_options['filters']['tid_2']['expose']['label'] = 'Country';
$handler->display->display_options['filters']['tid_2']['expose']['identifier'] = 'country';
$handler->display->display_options['filters']['tid_2']['expose']['reduce'] = 0;
$handler->display->display_options['filters']['tid_2']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['tid_2']['type'] = 'select';
$handler->display->display_options['filters']['tid_2']['vid'] = '4';
$handler->display->display_options['filters']['tid_2']['error_message'] = 0;
/* Filter: Taxonomy Tag */
$handler->display->display_options['filters']['tid_1']['id'] = 'tid_1';
$handler->display->display_options['filters']['tid_1']['table'] = 'term_node';
$handler->display->display_options['filters']['tid_1']['field'] = 'tid';
$handler->display->display_options['filters']['tid_1']['ui_name'] = 'Taxonomy Tag';
$handler->display->display_options['filters']['tid_1']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid_1']['expose']['operator'] = 'tid_1_op';
$handler->display->display_options['filters']['tid_1']['expose']['limit_operators'] = array();
$handler->display->display_options['filters']['tid_1']['expose']['label'] = 'Tag';
$handler->display->display_options['filters']['tid_1']['expose']['identifier'] = 'tag';
$handler->display->display_options['filters']['tid_1']['expose']['reduce'] = 0;
$handler->display->display_options['filters']['tid_1']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['tid_1']['type'] = 'select';
$handler->display->display_options['filters']['tid_1']['vid'] = '3';
$handler->display->display_options['filters']['tid_1']['error_message'] = 0;
/* Filter: Node: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
/* Filter: Content: Status (field_status) - Allowed values */
$handler->display->display_options['filters']['field_status_value_many_to_one']['id'] = 'field_status_value_many_to_one';
$handler->display->display_options['filters']['field_status_value_many_to_one']['table'] = 'node_data_field_status';
$handler->display->display_options['filters']['field_status_value_many_to_one']['field'] = 'field_status_value_many_to_one';
$handler->display->display_options['filters']['field_status_value_many_to_one']['value'] = array(
1 => '1',
);
$handler->display->display_options['filters']['field_status_value_many_to_one']['reduce_duplicates'] = 0;
$handler->display->display_options['path'] = 'showcase-stories-impact';
$handler->display->display_options['menu']['type'] = 'normal';
$handler->display->display_options['menu']['title'] = 'Showcase Stories of Impact';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['name'] = 'primary-links';

Not Working:

/* Display: Projects in Progress */
$handler = $view->new_display('page', 'Projects in Progress', 'inprogress');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['title'] = 'Discover Great Projects';
$handler->display->display_options['defaults']['header'] = FALSE;
/* Header: Global: Text area */
$handler->display->display_options['header']['area']['id'] = 'area';
$handler->display->display_options['header']['area']['table'] = 'views';
$handler->display->display_options['header']['area']['field'] = 'area';
$handler->display->display_options['header']['area']['empty'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter: Node: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'project' => 'project',
);
/* Filter: Search: Search Terms */
$handler->display->display_options['filters']['keys']['id'] = 'keys';
$handler->display->display_options['filters']['keys']['table'] = 'search_index';
$handler->display->display_options['filters']['keys']['field'] = 'keys';
$handler->display->display_options['filters']['keys']['exposed'] = TRUE;
$handler->display->display_options['filters']['keys']['expose']['operator'] = 'keys_op';
$handler->display->display_options['filters']['keys']['expose']['limit_operators'] = array();
$handler->display->display_options['filters']['keys']['expose']['label'] = 'Keyword:';
$handler->display->display_options['filters']['keys']['expose']['identifier'] = 'keyword';
$handler->display->display_options['filters']['keys']['expose']['single'] = TRUE;
/* Filter: Taxonomy Category */
$handler->display->display_options['filters']['tid']['id'] = 'tid';
$handler->display->display_options['filters']['tid']['table'] = 'term_node';
$handler->display->display_options['filters']['tid']['field'] = 'tid';
$handler->display->display_options['filters']['tid']['ui_name'] = 'Taxonomy Category';
$handler->display->display_options['filters']['tid']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid']['expose']['operator'] = 'tid_op';
$handler->display->display_options['filters']['tid']['expose']['limit_operators'] = array();
$handler->display->display_options['filters']['tid']['expose']['label'] = 'Category';
$handler->display->display_options['filters']['tid']['expose']['identifier'] = 'category';
$handler->display->display_options['filters']['tid']['expose']['reduce'] = 0;
$handler->display->display_options['filters']['tid']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['tid']['type'] = 'select';
$handler->display->display_options['filters']['tid']['vid'] = '2';
$handler->display->display_options['filters']['tid']['error_message'] = 0;
/* Filter: Taxonomy Country */
$handler->display->display_options['filters']['tid_2']['id'] = 'tid_2';
$handler->display->display_options['filters']['tid_2']['table'] = 'term_node';
$handler->display->display_options['filters']['tid_2']['field'] = 'tid';
$handler->display->display_options['filters']['tid_2']['ui_name'] = 'Taxonomy Country';
$handler->display->display_options['filters']['tid_2']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid_2']['expose']['operator'] = 'tid_2_op';
$handler->display->display_options['filters']['tid_2']['expose']['limit_operators'] = array();
$handler->display->display_options['filters']['tid_2']['expose']['label'] = 'Country';
$handler->display->display_options['filters']['tid_2']['expose']['identifier'] = 'country';
$handler->display->display_options['filters']['tid_2']['expose']['reduce'] = 0;
$handler->display->display_options['filters']['tid_2']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['tid_2']['type'] = 'select';
$handler->display->display_options['filters']['tid_2']['vid'] = '4';
$handler->display->display_options['filters']['tid_2']['error_message'] = 0;
/* Filter: Taxonomy Tag */
$handler->display->display_options['filters']['tid_1']['id'] = 'tid_1';
$handler->display->display_options['filters']['tid_1']['table'] = 'term_node';
$handler->display->display_options['filters']['tid_1']['field'] = 'tid';
$handler->display->display_options['filters']['tid_1']['ui_name'] = 'Taxonomy Tag';
$handler->display->display_options['filters']['tid_1']['value'] = '';
$handler->display->display_options['filters']['tid_1']['exposed'] = TRUE;
$handler->display->display_options['filters']['tid_1']['expose']['operator'] = 'tid_1_op';
$handler->display->display_options['filters']['tid_1']['expose']['limit_operators'] = array();
$handler->display->display_options['filters']['tid_1']['expose']['label'] = 'Tag';
$handler->display->display_options['filters']['tid_1']['expose']['identifier'] = 'tag';
$handler->display->display_options['filters']['tid_1']['reduce_duplicates'] = 0;
$handler->display->display_options['filters']['tid_1']['type'] = 'select';
$handler->display->display_options['filters']['tid_1']['vid'] = '3';
$handler->display->display_options['filters']['tid_1']['error_message'] = 0;
/* Filter: Node: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '1';
/* Filter: Content: Status (field_status) - Allowed values */
$handler->display->display_options['filters']['field_status_value_many_to_one']['id'] = 'field_status_value_many_to_one';
$handler->display->display_options['filters']['field_status_value_many_to_one']['table'] = 'node_data_field_status';
$handler->display->display_options['filters']['field_status_value_many_to_one']['field'] = 'field_status_value_many_to_one';
$handler->display->display_options['filters']['field_status_value_many_to_one']['value'] = array(
0 => '0',
);
$handler->display->display_options['filters']['field_status_value_many_to_one']['reduce_duplicates'] = 0;
$handler->display->display_options['path'] = 'discover-great-projects';
$handler->display->display_options['menu']['type'] = 'normal';
$handler->display->display_options['menu']['title'] = 'Discover Great Projects';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['name'] = 'primary-links';

netsensei’s picture

I had the same error.

I created a view with a calendar pager and eposed 2 vocabularies as dropdowns. The last filter returned me an "Illegal choice" error.

This solution fixed it for me: http://drupal.org/node/359149#comment-1219335

My view now defaults to - Any - on each page render

My settings:

[Operator] = is one of
[Options] = uncheck all items

Then, at bottom, check [Optional] and [Force single]

Same goes for Views 7.x:

* "Select terms from vocabulary XXXX" => make sure everything is unchecked
* Operator = "One of"
* None of the other options is checked

alexander.nachev’s picture

Version: 6.x-3.0 » 7.x-3.3
Issue tags: +views taxonomy exposed filter

I have the same problem. But it works excellent in chrome and safari. I have one drop down taxonomy exposed filter in views which ends up with "An ilegal choice ..." when its used in IE,Firefox and Opera. When I try the remember solution, firefox works only the first time it loads the page after i remember the default setting with chrome. Drupal 7 and views 7.x-3.3. Tried updating views on a test server and the problem is the same. It can be reproduced here: here. The "Марка" drop down is the problem.

Rob C’s picture

Version: 7.x-3.3 » 7.x-3.5

I've seen it 1 time now in Chrome, after i found the problem lots of time in Firefox and switched to Chrome.

By the way, i only get the message as stated in the title if i try to save a view after i get 'the bug'.

When i click on drop-down, after i add the field at filters, the page reload and a white page is loaded. Nothing works at that stage, can only close the window and try #14. So the title might be a bit misleading. (and the other odd thing is that i do not ever seen this till today, after i switched some sites to a vps. So i'm not sure about what the real 'suspect' is yet. (didn't update anything, just moved servers, that vps is running Aegir by the way, old server didn't...)

barraponto’s picture

@Rob C my issue was with my session or browser cache... logging out and logging in healed it.

millionleaves’s picture

Issue summary: View changes

I've just experienced this issue on a site I'm building. It's not browser-specific - in my case it was caused by an an invalid filter in an views attachment.

The view is a GMap view showing a map of retailer locations, plus an attachment that shows a table of retailers sorted by proximity to the address supplied in the exposed address search. I'd replaced two terms with one new one, added the new one to the address search, but hadn't added the new term to the attachment. Doing that fixed the error.