Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
16 Dec 2008 at 21:25 UTC
Updated:
23 Mar 2011 at 19:47 UTC
Jump to comment: Most recent file
Comments
Comment #1
dwwThis sort of does the trick. It correctly adds the 3rd radio and the validation.
The one edge case that's still broken is if you have an exposed filter with
<Any>selected and saved, then you press the "Hide" button, the 3rd radio goes away (as it should) but the validation is a little screwy. Originally, the validation message would just fire, but it wouldn't make any sense since neither<Any>nor "Optional" are even visible. I discussed with Earl in IRC, and he suggested that the form builder should ensure the #default_value is valid, which this patch does. However, due to some weirdness with the JS form stuff, this new #default_value isn't being used to auto-select the first choice as intended. I don't fully understand why, but Earl says this approach might need to be abandoned in favor of just using a more generic validation error message that makes sense in this edge case.Comment #2
dwwAfter further discussion with Earl in IRC, we figured the best we could do for this edge case was to use a more generic error message text so it made sense in both contexts:
"You must select a value unless this is an optional exposed filter."
Makes for a much smaller patch, at least. ;)
Comment #3
merlinofchaos commentedCommited to 2.x and 3.x branches. Can't believe I let this sit for 6 months. :/
Comment #5
AntiNSA commentedWhat if you are not using radios?
Comment #6
merlinofchaos commentedPlease don't re-open closed issues unless there is an obvious problem with the fix that was made.
Comment #7
AntiNSA commentedsorry
Comment #8
mikeker commentedApologies if it is not appropriate to re-open this issue... The patch in #2 does not handle the "Optional" option consistent with other Views data type handlers. For example, in a node->type filter, the
<Any>option is only available if "Optional" is checked.I wonder, though, if the original intent of this patch was to include the Any option so that a user could select, for example, both published and unpublished nodes. If that's the case, then perhaps we should expose the "Force single" option as one of the exposed filter options.
Anyhow, attached is a patch to make boolean data handlers consistent with other data handlers. A side effect of this patch is that there is no longer a need for the
value_validate()routine. I can open another issue regarding "Force single" for boolean data handlers if needed.Comment #9
mikeker commentedSlight update in this patch: it also handles the #default_value properly. (Changes
(bool) TRUE/FALSEto(int) 1/0.Comment #10
dagmarChanging to correct status.
Comment #11
merlinofchaos commentedmikeker: The reason we did not go with the solution you provided is that you have to click optional and then click update to make the "Any" option appear. That actually adds confusion to the UI.
The only way we could make this work is if we added a dependency to the radio. Which is going to be a pain.
Comment #12
esmerel commentedhttp://drupal.org/node/432208 looks to be a dup of this issue.
Comment #13
Bilmar commented#686550: Add 'any' option for Views exposed filter default values has been marked a duplicate.
Comment #14
ManyNancy commentedSubscribe
Comment #15
peterum commentedpatch doesnt work for me with an exposed flag filter :( i still can only choose true or false as the default value or rather flagged / unflagged which translates into true and false at the frontend
Comment #16
esmerel commentedIf this is still a problem, it should be a new issue and worked against 6.x-3.x or 7.x-3.x; the original issue was corrected.