Closed (fixed)
Project:
Voting API
Version:
5.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2006 at 16:21 UTC
Updated:
31 Mar 2007 at 07:31 UTC
When I created a view, if I add any fields related to VotingAPI (i.e. "VotingAPI: Voting results"), the view only shows the contents (nodes) that have been voted. This behaves like a filter which it shouldn't.
I tried to manually populate the "votingAPI_cache" table and gave every node a default voting score of 0. This actually fixed the problem and every node showed up in the view. But it broke the voting module so it is still a no go.
A rather tedious fix will be to vote each node manually which will take forever. Just wondering if there is a better solution for this? Thanks.
Comments
Comment #1
everbright commentedOk, I digged a little deep into the code. I was looking at the MySQL query generated from the devel module:
As I commented in the code, although it is a left join, if you use the columns from the right table in the where clause, the result set will be restricted to that table. Move those up to right after "left join ... on ... " should solve the problem. Something like:
I will try to put a patch for this (never done one before). Meanwhile, any suggestions or comments are welcome.
Comment #2
everbright commentedAfter some research, it seems to be an issue with the VotingAPI and its integration with Views.
Comment #3
everbright commentedAfter spending half a day, I gave up on the patch idea. I did a quick fix though to fit my needs. Below is my hack if anyone is insterested:
1. In the votingapi_views_tables() function (located in the votingapi_views.inc file), change:
to
2. Also comment out most part of the votingapi_views_value_query_handler function:
Question: I couldn't figure out how to programmably change the "extra" field of the table array using the "option" values. Any ideas?
Comment #4
eaton commentedAs of this evening at 2:06 AM, views integration for VotingAPI has been rewritten from scratch. All hail views! The good news? It should actually work. The bad news? You'll need to remove and re-add any VotingAPI fields that you had on existing Views. This shouldn't be problematic, as the old views integration was completely broken anyhow.
Caveats: Output formatting of vote results, etc is still being finished. In addition, much more testing is needed before it can be said that the new integration code is 'ready for prime time.' But it's definitely much better. I'm going to be closing the existing threads regarding VotingAPI and Views because all of them point to known issues with the *old* versions of the code. Those interested in testing the new code can download the latest VotingAPI from: http://drupal.org/node/128605
Thanks for your patience!
Comment #5
(not verified) commented