Closed (fixed)
Project:
Flag
Version:
6.x-1.1
Component:
Views integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 May 2009 at 04:15 UTC
Updated:
12 Oct 2009 at 16:40 UTC
the flags filter allows "Optional," which is great, but doesn't allow an empty default setting.... requires either True or False. Wd be nice to allow empty there.
Comments
Comment #1
quicksketchI don't understand the request here. In flag's database tables something "not flagged" (False) is the same as being empty.
Comment #2
quicksketchAlso, see the handbook page on Listing content that is not flagged, if that's what you're looking for.
Comment #3
aharown07 commentedI'm talking about the default setting for the filter. It's easy enough to find unflagged and flagged, but the flag filter does not currently allow the
<any>setting as a default, as alot of other filters do. In our situation, a default that finds all flagged and unflagged makes more sense.Comment #4
quicksketchI think the difference is caused by Flag's data storage. Flag does not store "1" and "0" for the status of a flag. Instead it just stores a row if the item has been flagged by a user and deletes a row if the user unflags an item. So having "True", "False", and "Any" doesn't make sense because "Any" is the same as True (the row exists in the database table).
Comment #5
MickC commentedI'm using this workaround:
change $operator = $this->value ? 'IS NOT' : 'IS' ;
to $operator = $this->value ? 'IS NOT' : 'IS NOT NULL OR flag_content_node.uid IS' ;
Note that all this does is makes the False option an Any option, so you can default to False and ge everything in the view.
I figure if it's a binary option, then this is the lesser of two evils - in my case I don't need the 'not flagged' view, just 'flagged' or 'all'.
However a permanent solution would be nice - it would be good to be able to default to 'Any' as with most other filters.
Comment #6
rjdempsey commentedI need to do the same. Where do you put this code?
Comment #7
quicksketchThis was fixed in #403602: Views Flagged Filter Option for Any.