3

I am having a very odd problem with an exposed filter in one of my Views. The page I am talking about is here: http://epsindustry.org/eps-packaging-map2

When I select one of the last 2 options in the menu (EPS Packaging Recyclers or Loose Fill Recycling Drop-off) I get an error that says An illegal choice has been detected. Please contact the site administrator. This is really weird to me because it only happens with these 2 options. I don't believe they are set up any differently than the other taxonomy terms. There's nothing all that special about them, its just a term that the admin selects when creating a location for the map.

Any ideas as to why this is happening or how to fix it?

1

I was having the same issue. In my case the 'illegal choice' message was displayed when changing the country from 'United States' (the default value) to 'United Kingdom' and selecting 'North Yorkshire' as state/province and saving.

I did the following to fix it:

  • Go to the Configure page of the Location field (by editing the node type and going to 'Manage fields').
  • In the 'Events settings' section (not the 'Locative information' section), there is a drop down group called 'Default value'. I set 'Country' to United Kingdom.
  • Save field settings.
  • Done.

Using:

  • Drupal 6.28
  • MySQL 5.1.72
  • PHP 5.3.3.7+squeeze17
  • Location: 6.x-3.3-rc3+6-dev (2013-Oct-25)
  • GMap Location: 6.x-2.0-beta5+1-dev (2013-Sep-30)

Hope it helps.

0

I also faced the same problem i used query alter

I have used node reference as my select field. you can dynamically chance and set the value for select list

STEP 1: uncheck select all option and select any one item in the drop down.

Step 2: alter your value based on what page you are in with use of arg() values.

We used to change the select based in the node id for every node we select one option dynamically. Below is the sample code we used to alter

function modulename_views_query_alter(&$view, &$query) {
    if($view->name == "view_name"){
          if($view->current_display == "block_name"){
        $query -> where[4]['conditions'][1]= array('field' => 'field_data_field_field_name.field_selectlist_id', 'value' => $passthevaluetobesent, 'operator' => '=');
            }
    }
}

enter image description here

alter the condition class in query alter according to your need dynamically

hope it will be helpful dude.

0

This can also be caused by a reference to an entity that is set to Unpublished. If you reference an entity and want the options to be visible to Anonymous users the entity will need to be published.

0

Generally this issue is coming when the exposed form is getting undefined value, if you limit the items to the selected list it will not be taken any other undefined values.

So go to the corresponding filter criteria field and if you check the exposed checkbox you can there is a checkbox "Limit list to selected items". Now check it and save the view.

Thats all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.