By default an exposed optional multi-select filter on taxonomy vocabulary implies "any" when no options have been selected, the result being that all relevant nodes are returned regardless of what, if any, taxonomy vocabulary they have been associated with.
When the exact same view is used with the exposed filter form altered with hook_form_alter, so that checkboxes are used instead of a multi-select form element, the expected behaviour breaks down. When no checkboxes are checked the view returns nothing instead of the expected full listing of all relevant nodes regardless of any associated taxonomy vocabulary. Checking all of the checkboxes returns all of the nodes with an associated taxonomy vocabulary. There is no way to have the view output the nodes that do not have an associated vocabulary.
Switching the exposed filter form back to its default multi-select form element corrects the problem.
While exploring this issue I read through http://drupal.org/node/507556, which is somewhat related, but different.
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedPlease specify exactly how you have the filter configured. In particular, the setting of the 'operator' is crucially important. Exporting a view that exhibits the behavior you think is wrong will be the best way to demonstrate to us that it is wrong.
Comment #2
Beanjammin CreditAttribution: Beanjammin commentedHere is the exported view along with some additional information.
I notice that when the exposed filter form is unaltered the resulting SQL is:
When the exposed filter form is altered the resulting SQL is:
This is how I am altering the form:
Here is the exported view:
Comment #3
dagmar@Beanjammin please remember change the status when you "provide more information"
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedWhy is it that form altering something that works in Views to something else that doesn't work is a bug in Views? Sounds like a bug in your form alter, to me; or more likely, you're trying to do something that doesn't work. Note: checkboxes in exposed filters generally don't work. That's not Views' fault, it's just the way checkboxes work in GET forms.
Comment #5
bkosborneThis module may help others looking for a checkbox solution
http://drupal.org/project/better_exposed_filters