Hello,

I have installed the VotingAPI and Rate modules for Drupal 7. It automatically adds a link to my navigation menu: "Top content". After having rated some posts to test it out, the voting results were all still 0. Confused, I edited the View, only to find that it doesn't allow me the option of selecting the appropriate Vote Tag. Instead, I have "No Filter" and "Normal Vote". However, I have existing rating widgets with tags of a different name, eg. "Content".

I have read the README.txt for both Rate and VotingAPI and followed their instructions, but I am unable to follow the instruction that says: 'The "Value type" and "Vote tag" needs to be the same as used for the widget (see §2.1).' I can't find anybody else with the same problem on the forums.

This is vital to my project, so I'm really hoping somebody is able to help!

Thanks,

Paragon

Comments

Paragon’s picture

To add to the above, the actual ratings are definitely being stored properly. I can view average ratings for each individual node, but I cannot pick the correct voting tag in order to aggregate the ratings in a view.

Paragon

Paragon’s picture

I have since experimented more with the Views module and successfully made other views, and I still do not understand why I am not getting the appropriate 'vote tags' selection. If anyone knows anything about this, it would be a huge help to me.

Thanks again,

Paragon

Thrixke’s picture

I hope this is what you are looking for (at least it solved my problem):

In your rate.module-file there's an if-statement on line 859. That's not right. Turn it in to comment, but keep the return statement, like this:

   //if ($tag == $widget->tag && $value_type == $widget->value_type && in_array($node_type, $widget->node_types)) {
      return rate_generate_widget($widget_id, $content_type, $content_id, $mode, TRUE, FALSE, $displayed_rating);
    //}

Now the rate-widget shows up in the options in my view.

Hope this helped.

msypes’s picture

I tried this: Saw no difference.

Michael

Tilo’s picture

I had the same issue with 6.x-1.3. The corresponding row on this version is 901.
After commenting as described the widget works as expected.
Many thanks Thrixke.

dmf7’s picture

I looked for the code you have above, however, it's different in my drupal 7 version of rate module. I found this: it comes closes to what you have posted:

// Loop through all the widgets and search for a suitable widget to display.
$widgets = variable_get(RATE_VAR_WIDGETS, array());
foreach ($widgets as $widget_id => $widget) {
if ((!isset($tag) || $tag == $widget->tag) &&
(!isset($value_type) || $value_type == $widget->value_type) &&
(in_array($node_type, $widget->node_types) ||
$field->view->base_table == 'comment')) {
return rate_generate_widget($widget_id, $content_type, $content_id, $mode, TRUE, FALSE, $displayed_rating);
}
}

Im not sure what to do here to get the rate widget to display in the output of my view.

any idea?

Thanks

vitkuz’s picture

I have the same problem. Please sombody help :-)

Thrixke’s picture

I'm looking for a solution too.

I wonder if it has something to do with the field in wich you choose where to display your rate widget in the settings of the rate module. You have two options there: node and comment. No views option though...