Views: Filtering "Voting API results: Value" "is less than" should include NULL votes
wmostrey - November 10, 2008 - 13:02
| Project: | Voting API |
| Version: | 6.x-2.0-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Currently when selecting the "Voting API results: Value" filter and choosing for "Is less than" (less than 3 for instance), nodes that haven't been voted on are being excluded from the view. They only appear when using the "is empty (NULL)" operator. It seems obvious to me that nodes with 0 votes should appear when selecting nodes with less than 3 votes for instance.

#1
I'm not sure that it's obvious: there are bugs that specifically deal with the fact that 'no votes' should NOT appear as having any vote value (http://drupal.org/node/311132). I'm thinking through ways to offer both options, but at present the problem is that NO VOTES are present in the database. That means that you'll get a NULL for the node's rating, not a Zero. Although it formats he results as a 'zero' when displaying a node with no votes, for sorting purposes the database treats it as something else entirely.
#2
I think the most sane solution would be to have two operators: "Is less than (include NULL)" and "Is less than (exclude NULL)". I understand the need to differentiate between nodes with a total vote count of 0 (for instance after having a +1 and a -1 vote) and nodes that haven't been voted on. Adding this new operator would fix that.
#3
I was just wondering what the decision on this would be. Does anyone know a quick fix for also including NULL votes to the "is less than" list?
#4
subscribing.
you don't really need those two options, though, do you?? if the views relationship is required, it's an inner join and nulls shouldn't be returned.