This is a result of the fix in #403602: Views Flagged Filter Option for Any. The "Any" option is added to the exposed filter regardless of whether "Optional" is checked or not.

The attached patch fixes that.

Note: The values that appear in the exposed filter itself seem to come from somewhere else and not do respect the "Optional" checkbox either. I'll try and look into this some more, but if someone knows where in the Views API the exposed filter is built, please chime in. Thanks.

Comments

mikeker’s picture

Status: Active » Needs review
quicksketch’s picture

Status: Needs review » Fixed

Excellent thanks mikeker! Committed.

Status: Fixed » Closed (fixed)

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

dragonwize’s picture

Status: Closed (fixed) » Needs review

This patch need to be backed out.

The issue #686550: Add 'any' option for Views exposed filter default values was marked duplicate of with reason that it needs to be fixed in views in #347892: UI for boolean filters doesn't handle the "optional" exposed filter case.

That is incorrect. If you read the whole issue Earl specifically says that the All/Any option is always shown even when the optional box is not checked. Yes it is not the most usable solution but neither are many of the other solutions. Both Earl and Derek gave solid reasons as why they are not implementing that right now. So having the All option showing is the current correct way of using the views api on boolean filters.

quicksketch’s picture

Hm, I'm not sure about this one. Seems like a feature regression. Flag specifically creates it's own boolean handler for clarity and it doesn't have to worry about the re-usability of the generic boolean handler like Views does. But then again, #347892-15: UI for boolean filters doesn't handle the "optional" exposed filter case desribes having the exact problem that merlinofchaos wanted to avoid.

My preferred approach is the current one, even if it's not what is used by the generic Boolean handler.

dragonwize’s picture

The current approach does not work at all though.

The any option is added to the drop down but you can not select it as a default which means that that it will always default to either true or false on the exposed filter. That means that the remember option completely does not work because the option is not an available option to remember. Meaning that every single time you hit a view page with an expose flag filter you HAVE to change the flag option on every single page load.

By simple reverting this patch all of that is fixed.

dragonwize’s picture

Sorry I was getting a little too heated.

What I am trying to say is that I think that having all the features work work but have a minor usability issue on the admin side is better than having features not work and having a usability issue on the users side.

quicksketch’s picture

having all the features work work but have a minor usability issue on the admin side is better than having features not work and having a usability issue on the users side.

I completely agree here. If we roll back the patch, it makes it so that the "All" option is always available and can't be turned off, even if that's what's desired by the administrator.

The best situation here would be to make the "All" option always available when configuring the filter, but only show up if the filter is optional on the user side. However I'm not sure if this is a possibility. Reverting the patch makes it so that "All" is available all of the time, for both users and administrators.

quicksketch’s picture

Title: Exposed filter includes "Any" option when "Optional" is unchecked. » Exposed filter includes "Any" option when "Optional" is unchecked (Regression bug, revert)
Status: Needs review » Fixed
StatusFileSize
new1.32 KB
new1.32 KB

After a long hiatus from looking at the Flag queue, I revisited this issue today and I have to say that I was wrong, wrong, wrong here. I really apologize dragonwize for completely missing the point here.

Some how I thought that options_form() was providing the form for the *end-user* as well as the administrator. However this is completely not the case. options_form() is for the administrator only. So ironically the very last thing I said in this issue, quote:

The best situation here would be to make the "All" option always available when configuring the filter, but only show up if the filter is optional on the user side.

Well dur! That's what you've been saying from the beginning and exactly what would be accomplished if this patch were rolled back. Sorry for all the frustrations and I'm really sorry I didn't pick up on this earlier. We both wanted the exact same thing but I just wasn't picking up on it.

Patch rolled back with this patch. Thanks for the help with this one even though I didn't get it.

Status: Fixed » Closed (fixed)

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