Hi. I'm trying to sort comments on a node by votes (up/down widget).

As it doesn't seem possible with Drupal standard's comments list, I built a view (if you have anything about it, it would be perfect !).
The view has "Comments : Vote results" for relationship, with right value type (points, for up/down). Aggregation is total score.

The right result of the vote shows when the "Vote results: value" field is set to "Default appearance", but when I set it to "rate widget", it doesn't show.

it worked perfectly for the same thing with nodes and not comments.

Was I wrong somewhere or is it a feature request ?

Thank you all.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mfb’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Component: User interface » Code
Priority: Major » Critical
Status: Active » Needs review
FileSize
1.32 KB

It would appear that this module is not working at all with comment views on Drupal 7.. Patch is attached..

pixel8r’s picture

Patch didn't work for me. Any other suggestions? I am just trying to display the widget straight in the comments.

I am using rate-7.x-1.x-dev

** UPDATE **
The patch works. My issue is that I am using Display Suite. Once display suite was disabled for comments - voila!. I am not sure how to fix this issue for Display Suite :(

**************

FAAREIA’s picture

Status: Needs review » Active

Here is a similar issue. http://drupal.org/node/1305042

We really need this issue resolved. I'm using views to make my comments and i can't print the widget, i tried some stuff but none of them worked.

Thanks for any help.

mfb’s picture

Status: Active » Needs review

This patch still applies on 7.x-1.x branch (with offset)

mauritsl’s picture

Status: Needs review » Fixed

Committed to GIT. Thanks!

imoreno’s picture

Status: Fixed » Needs work

this issue is still not fixed - i have used the patch from #1 - still no display of the rate widget. I'm using panels so it might be a separated issue.

imoreno’s picture

With the last 2012-Sep-01 7.1.4 version - problem is still there, unable to display any widget in a comment view. only default which display numeric value.

BR
Itzhak

svanou’s picture

Same problem here.
I set up Relationship to be Comment: Value with proper settings. Vote up/down and points
Then, I add a field comment: value but the widget does not display.
What I want to achieve is a rating system on comments. Can someone help me with that?
Thanks, Sylvain

Ronino’s picture

I can confirm that there seems to be no way to display a widget in a comment view for now. I checked the latest dev version but it looks like a complete rewrite which now is field-based like fivestar. In its view field configuration there was no formatter selectable, so this doesn't work either. Somehow we're stuck...

Ronino’s picture

I wrote:

I checked the latest dev version but it looks like a complete rewrite which now is field-based like fivestar. In its view field configuration there was no formatter selectable, so this doesn't work either.

The dev version drush was installing was 2.x which explains why it looked like a total rewrite ;-).

After struggling for hours not being able to display any widget, I analyzed the code and came to line 985 in rate.module in version 1.4:

if ((!isset($tag) || $tag == $widget->tag) && (!isset($value_type) || $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);
}

The last test checks for the node type which is ONLY set if you not only check the comment checkbox for your widget under admin/structure/rate but also the node checkbox. Thus the comment widget only appears if you check both checkboxes.

Solution: Apply the attached patch (created for 1.4, also works with latest 1.x-dev). I only tested it in this particular scenario, I don't know about possible side effects.

Workaround: Check the node checkbox for your node type in the respective widget and the widget will appear in comment views, too. You also might want to turn off the widget display for nodes in the display settings.

Ronino’s picture

Status: Needs work » Needs review
mauritsl’s picture

Status: Needs review » Fixed

Committed to GIT. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.