Archived May, 2026.

Topic Ratings Plugin

jumagura

A Discourse plugin that lets you use topics to rate things!

Features

  • Rate topics by a star rating system in the composer.
  • Enable different rating types on a per-category or per-tag basis.
  • Toggle rating count and average rating per rating type.
  • Toggle visibility of ratings, counts and averages based on user roles.
  • Bulk actions including rating type migration

:page_facing_up: Get the code

:bug: Report a bug

Lost?

  • Not sure how to install a plugin? Follow the steps here.

  • Make sure you check out all the site settings for this plugin by searching for “Rating” in your admin settings.

:wave: Before you post in this topic, bug reports or feature requests over at thepavilion.io are much appreciated (it’s easier to manage than one big topic!). If you just have a quick question, it’s fine to post that here.

angus

Ok I’ve made a simple frontend exclusion of the ratings stars for users that have already posted in a ratings topic.

Ideally, I’d like to modify the topic and/or post guardians on the server to prevent a user from posting in a ratings topic twice. However, with my limited ruby skills, I can’t see an easy way to do this without just overriding the existing methods (assuming that’s possible this isn’t a very sustainable thing to do)… any ideas/tips? @sam

Relevant topic guardian method

Relevant post guardian method

zogstrip

We need to add plugin hooks here.

fackelwind

Where is the button in the composer UI or for the finished post to rate the thread?
I have installed the plugin, given the thread the “rating” tag, and can see the empty stars at the top. But no button to actually rate it. :frowning: (Or must I use a non-admin account for that?)

EDIT: looked closely at the screenshots, and see that there is supposed to be a “Your rating” line there. Well, it’s missing in my instance.
Thought of a second reason this might not work: My instance is German. If the translation is missing…

Will create a test user and set his user interface to English. If it still does not work then something is broken.

fackelwind

OK, mystery solved. As a normal user, I can answer even though my user interface is still in German.

Warn a guy about stuff like that, will ya! :wink:

(An option to allow admins to vote too would be honestly appreciated, though.)

Edit: Celebrated too early, its still broken.
I had the option to select stars on posting the initial reply. That did not affect the overall rating, though. And on editing the reply, the “Your rating” line is missing again. :frowning:
Switched the user interface of the test user to English - no change.

Help!?

angus

@fackelwind Thanks for the feedback! I appreciate it. This precipitated a significant refactor to get it working as expected. In retrospect I’m surprised it worked before at all…

The only thing that doesn’t work now is the topic average will not get automatically updated for other users when a new user publishes a post with a rating or edits a rating in a post. Other users will see the updated rating on the new or updated post itself, but the topic average rating won’t update until those other users refresh. I will fix that soon.

Here’s a screencast demonstrating the functionality: http://quick.as/b1wbSOa9g

@zogstrip @riking Hey guys, could you give me some advice on the best way to push topic updates to other clients from the server? I’m pushing the post updates using the aptly named post method publish_change_to_clients which uses the MessageBus. But I’m not sure of the best way to do the same for the average_rating custom field I’ve created for topics. I can send it to back to the current user’s client easily enough, but other clients? I’m sure it’s relatively straight forward, but with my basic ruby skills the answer isn’t jumping out at me…

riking

You want to use MessageBus.publish(channel, msg, group_ids: topic.secure_group_ids) with the same channel and a different message.

I’m not quite sure how to hook into the MessageBus.subscribe() call on the client, though…

fackelwind

Alright, installed and quickly tested.
Rating now works (great!). However, I can rate all threads, whether or not they have a rating Tag attached. I also see stars under each Thread title (again, no rating Tag). Not ideal…
Klicking on the stars on the published post does not work (I think having to edit the post is fine, but since you advertised it, I am telling you about it).
Is there a way for the user to remove a rating again? (Not necessary, but nice to have.)

I will test more later today.

Just one more request: When you implement your restriction to one post per user in any rating thread, can you make that a setting? I think for my use case having a proper back and forth discussion might be better (of course with a limit of one rating per user :wink: ).

angus

Thanks, I’ve got it working now. I was getting confused by the last parameter, i.e. the user or group ids, on the publish function; it made me think it wasn’t apposite for this case.

The topic controller subscribes to the message bus here. The ‘revised’ type case already handles the post update, so all I needed to do was set the bus message type to ‘revised’ and then add extra logic to save the average to the client’s topic model for the ‘revised’ case, i.e.

then

@fackelwind topic averages now update automatically for all clients when any rating is changed.

angus

Yes, I see the issue, I’ll fix it tomorrow morning.

Klicking on the stars on the published post does not work (I think having to edit the post is fine, but since you advertised it, I am telling you about it).

Yes I should have mentioned, I removed that functionality (updated the description accordingly now). So you can only rate in the composer itself.

Just one more request: When you implement your restriction to one post per user in any rating thread, can you make that a setting? I think for my use case having a proper back and forth discussion might be better (of course with a limit of one rating per user :wink: ).

Yes, I think I’ll make it a setting.

Thanks!

fackelwind

Thanks a bunch for your fast response!
I did not have a lot of time this morning, so I just sent of a very quick response. I want to really thank you for this plugin, it matches perfectly with what I want to make possible for our community! (completely new site, so I am free to play around with a still maturing plugin. :wink: )

Another Bug Report from me:

  • Right now, every post can vote, even when that user has already replied and voted in the thread.

  • If you do not vote, it counts as 0 stars. I don’t think this is the correct way to handle it: A non-vote should not influence the average at all. And just posting into a thread which can rate should not lower the average opinion about the topic. Besides, once you have klicked onto 1-5 stars, you can never go back to 0 stars, so even if there just had to be a default vote, it would not be correct.

And a wishlist item: Some way to see the precise average, and how many people have rated the topic how highly. Kinda obvious if you look at amazon or wherever. Just making sure. :wink:

EDIT: Since it might not be obvious: Even though I report everything that looks wrong to me, and even write down whishlist items, the most important thing is that the plugin does not influence threads which it shouldn’t (no rating Tag, category not marked for rating). People are starting to use my discourse instance. Whether this plugin does or doesn’t work correctly is not a big deal as long as only the rating trial topic is influenced. When every single thread is modified, that is a much bigger problem. (All topics created today show stars…)

fackelwind

I have deinstalled the plugin again for now (rebuild the docker instance without it), to get rid of the visual clutter on threads that were not supposed to be rated.

I will happily retry it once that bug is fixed (though having to rebuild the instance for that, with the associated downtime, is unfortunate).

angus

I have made sure the topic averages will not be applied to new topics in a non-ratings category or without the ratings tag. Unfortunately this won’t fix existing topics with empty ratings you’ve made in your instance. If that is a significant issue, I’ll see if I can figure out how to fix it.

Right now, every post can vote, even when that user has already replied and voted in the thread.

I can’t reproduce this one. Could you check again if you re-install the plugin. Thanks.

If you do not vote, it counts as 0 stars. I don’t think this is the correct way to handle it: A non-vote should not influence the average at all. And just posting into a thread which can rate should not lower the average opinion about the topic. Besides, once you have klicked onto 1-5 stars, you can never go back to 0 stars, so even if there just had to be a default vote, it would not be correct.

Yes this is an issue. I think the way to handle it is if the user does not select a rating in a post, that post does not get a rating included. That user could still post on that topic with a rating in another post. Of course, once I add the setting to prevent a user posting in a ratings topic more than once, I will have to require that the user adds a rating to their single post. I will fix this one within the next two days.

And a wishlist item: Some way to see the precise average, and how many people have rated the topic how highly. Kinda obvious if you look at amazon or wherever. Just making sure. :wink:

Yes this is possible. I think I’ll add it next to the topic stars and add later a setting to show/hide it. I will do this one on the weekend.

fackelwind

This is a significant issue, but not in the way you think. Having an SQL query to run against the DB (to remove the empty ratings) would not really help.
Think about this: How do you intend to handle the case where someone removes the “rating” tag from a topic? Or in any other way removes a topic from being a rated one?
I would argue that the only sane way for you to handle that case is to treat it as a vanilla topic: No stars, no possibility to rate, no restrictions in the amount of posts. So you don’t only look whether there are ratings when deciding on whether to draw stars or not, you always check whether the topic fulfills the criteria of being a rated one. (I have honestly no idea what you intend to do when someone tags an existing topic with “rating”, the setting to restrict it to one post per user is active, and users have already posted more than once…)

And if you have implement that, I won’t have any problems with stale ratings either. :wink:

I’ve got a discourse docker instance lying around on my desktop. Tell me when you have a version which you think should work, and I’ll test it there. :smiley:

angus

Sure, I’ll play around with the ‘removal’ case tomorrow morning.

This morning I migrated this to the new plugin api.

angus

Ok! Finally had some time to work on this. Made various bugfixes and updates. Inter alia, I changed the category property that signified whether the category had ratings enabled, so existing categories with ratings enabled will have to be re-enabled to work.

The ratings tag and category toggle is now handled within the composer. If the creator of a topic removes/adds a ratings tag or changes from a ratings category in the first post of a topic the topic will refresh after they post and the ratings will show/hide depending on whether their action was to turn ratings on or off. If ratings are turned ‘off’ on a topic they are still there in the DB. If ratings are turned back on the same ratings will appear again.

Tomorrow or the next day, I’ll apply the same logic to the topic title edit (i.e. if the creator of the topic changes the category or tags by editing the topic title).

Then I’ll add the exact numeric rating to topics title sections and add a setting to toggle it. Then I’ll add an indication that a topic has ratings if those ratings are hidden (i.e. if the category or tags were changed) and a setting to toggle this too.

fackelwind

That sounds really good!
I’ll play around with your plugin this weekend, see whether I have any more bug reports for you. :smiley:

angus

Tomorrow or the next day, I’ll apply the same logic to the topic title edit (i.e. if the creator of the topic changes the category or tags by editing the topic title).

This is done.

angus

Thanks @DavidGNavas for the Spanish translation!

https://github.com/angusmcleod/discourse-ratings/pull/2

pfaffman

It seems that the ratings plugin makes messages unavailable. Here are some logs. It looks like somehow messages don’t know that they don’t have ratings.

Logs.txt (43.7 KB)

When I disabled the ratings plugins my messages worked again.

Version	v1.5.0.beta11 +267	1.5.0.beta11
angus

@pfaffman Thanks for the bug report!

Should be fixed now:

fackelwind

Fixed:

  • I can freely enable and disable the rating tag from a thread and the ratings appear and disappear accordingly. Fantastic!
  • If I have already answered in a thread and answer again, I can’t vote a second time. :thumbsup:

Buggy/Quirky:

  • If I add a “rating” tag while creating a thread, I have to give it a rating. If I modify the thread opening post and add the rating tag, I do not have to rate (and end up with 0 zero star rating…).
  • As a normal user, I am unable to reply without selecting a rating. I’d rather not force my users to have to vote to be able to reply, but it’s ok if other solutions are more work.
    However:
  • If a user ends up having voted multiple times for whatever reason (in this case, because the posts where made with an older plugin version), he is unable to correct that: He can not remove having voted from a post. Otherwise, I as an admin could fix up posts from other users as well as my own…
  • Deleted posts count towards votes. I’d strenuously argue that these votes should not count.
  • If a post has no vote (because the topic did not have the “rating” tag when the post was made), it’s not possible to add it in afterwards. The only way is to make a new reply.

Except for the deleted post voting, none of this is really a bug. But I get the feeling that giving the option to add and remove your vote from your post would make this voting system more intuitive, flexible and robust. :wink:

After seeing that I can reliably disable the plugin by removing the tag “rating”, I have added the plugin into the productive discourse instance again. So I’ll be able to report any other oddities I observer. :smiley:

Other than that, I am looking forward to the exact vote average, and maybe also to a listing of how many people have rated the topic how highly. :wink:

Thanks a lot for your continuing work. The plugin is improving by leaps and bounds! :tada:

angus

As always, my thanks for your fantastic feedback.

If I add a “rating” tag while creating a thread, I have to give it a rating. If I modify the thread opening post and add the rating tag, I do not have to rate (and end up with 0 zero star rating…).

This is fixed.

angus

Deleted posts count towards votes. I’d strenuously argue that these votes should not count.

This should be fixed. If a post is deleted its rating will automatically be removed from the average. If the post is restored, its rating will be added back to the average. This should also work with existing ratings topics.

There may be some remaining issues to iron out with this one, but it seems to be working in my local testing.

https://github.com/angusmcleod/discourse-ratings/commit/74fd87d41e42caf29790b6dba0532b8b66862a01

angus

With these two, I see your point, however I think I might work on this kind of thing a little later. They are not functionality issues per se.

As a normal user, I am unable to reply without selecting a rating. I’d rather not force my users to have to vote to be able to reply, but it’s ok if other solutions are more work.

If a post has no vote (because the topic did not have the “rating” tag when the post was made), it’s not possible to add it in afterwards. The only way is to make a new reply.

For this one

If a user ends up having voted multiple times for whatever reason (in this case, because the posts where made with an older plugin version), he is unable to correct that: He can not remove having voted from a post. Otherwise, I as an admin could fix up posts from other users as well as my own…

This is a ‘legacy’ issue. I can fix it for you if it’s an issue on your live site, but if it’s just a dev issue, I might leave this one for now.

Cheers!

When I next have time in the next few days, I’m going to test the deletion discount from averages a bit more and add the exact averages and an indication of hidden ratings.

fackelwind

Thanks for your fast replies and changes!
No, I only have a single thread with votes atm, which is intended for testing. Having voted multiple times there makes playing around easier. :smiley:

Something is more weird after the plugin update than before:
I have currently the votes 0,4,2 which result in a one star rating. But I swear that before the update, changing that 2 into a 3 was enough to give me an average 2 star rating.
I have now changed the ratings to 0,4,5 and raised the rating of the deleted comment to 5. I still only get a 1 star average.
Is the rating maybe not getting updated at all anymore? There are two more comments in the thread without a rating (no stars shown).

Found another bug, and a pretty weird one:
Normally, when you refresh (F5) the browser window after having edited a post, it simply reloads the current thread. If you refresh a rated thread after having edited a post, the edit is shown again (I then cancel the edit, and everything is fine again.)
wtf?

angus

Indeed. I had to add a ‘rating_weight’ property to accommodate deleted posts with ratings (and perhaps to use in the future for weighting ratings differently according to poster, or other metadata such as likes). This subsequently changed the calculation of the topic average from this:

@topic_posts = Post.where(topic_id: post.topic_id)
@all_ratings = PostCustomField.where(post_id: @topic_posts.map(&:id), name: "rating").pluck('value').map(&:to_i)
average = @all_ratings.inject(:+).to_f / @all_ratings.length

to this:

@topic_posts = Post.with_deleted.where(topic_id: post.topic_id)
@ratings = []
@topic_posts.each do |post|
  weight = post.custom_fields["rating_weight"]
  if weight.blank? || weight.to_i > 0
    rating = post.custom_fields["rating"].to_i
    @ratings.push(rating)
  end
end
average = @ratings.inject(:+).to_f / @ratings.length

The rating_weight of deleted posts is set to 0. This logic (I think) accommodates rating weight by only counting ratings if the weight is greater than 0 or is blank (to support posts with ratings posted prior to this change). However, the problem is that it also counts posts without a rating at all.. So I’ve changed it to:

@topic_posts = Post.with_deleted.where(topic_id: post.topic_id)
@ratings = []
@topic_posts.each do |post|
  weight = post.custom_fields["rating_weight"]
  if post.custom_fields["rating"] && (weight.blank? || weight.to_i > 0)
   rating = post.custom_fields["rating"].to_i
   @ratings.push(rating)
  end
end
average = @ratings.inject(:+).to_f / @ratings.length 

This also checks if the post has a rating before counting it. A silly mistake on my part really. The problem is that I’m always working on this either early in the morning before work or late at night when the brain is softer…

I hope that fixes it.

https://github.com/angusmcleod/discourse-ratings/commit/615e2388e7475077e348241113fe335a631188b0

fackelwind

It does fix it. 5,4 and 0 now give me a rating of 3. Perfect!

At some point please take a look at the other weird bug I described as well.

Thanks a bunch for your work!

smartwatchme

This looks great - would the rating of the topic be displayed in Google at all? i.e:

angus

Normally, when you refresh (F5) the browser window after having edited a post, it simply reloads the current thread. If you refresh a rated thread after having edited a post, the edit is shown again (I then cancel the edit, and everything is fine again.)

Yes this is a tricky one. I’ve been trying to pin it down this morning. This is what I’ve discovered so far:

  1. It only occurs if you only change the rating on a reply by editing it. If you change the rating on the first post in a topic or change a rating in a reply and also change the content of the post, it does not occur.

  2. The composer opening is triggered by this method in the topic-from-params route:

if (!Ember.isEmpty(topic.get('draft'))) {
        composerController.open({
          draft: Draft.getLocal(topic.get('draft_key'), topic.get('draft')),
          draftKey: topic.get('draft_key'),
          draftSequence: topic.get('draft_sequence'),
          topic: topic,
          ignoreIfChanged: true
        });
      }
```

So in other words, if only the rating is changed and the title and reply remain the same when an edit to a reply is saved, the ``draft`` attribute of the topic view is populated on the server.

However, it turns out that this is true generally of Discourse. If you edit a reply, do not change the title or reply content and then 'save' the edit, the composer will re-open if you refresh the page: http://quick.as/m1vrS6JxV

Is this a bug or is it intentional? @riking @zogstrip @sam
zogstrip

Not sure, I haven’t touched that part. Maybe @eviltrout knows better?

angus

Just added exact topic averages next to topic star ratings, controlled by the Plugins setting Show exact average rating

angus

Added a note for admins if a topic has hidden ratings (if category or tags were changed).

angus

Probably not, but it’s a good feature to add! Will have a look at this soon.

angus

This plugin is now at v0.2.

Apart from the composer re-opening issue, which may be a Discourse bug, the plugin is now reliably working as described. To do list in first post reflects ongoing agenda.

angus

Forgot to mention here, but the bug with the composer reopening should be fixed now if you update Discourse to include this commit.

angus

Feature request from github:

My team is building a site called Science Commons where academics can discuss research papers. Each topic is about a single paper; the first post is a “wiki” that contains a summary of the paper. I would like to use your rating plug-in for Science Commons. But my concern is that when I turn on the rating tag, I am forced to give a rating on the first post. Is there a way such that no rating is required for the first post? I want to be an impartial admin who posts the paper and don’t want to give my own opinion about the paper.

I’ve thought of adding this previously and will add this as a setting in a few days time, after finishing the current batch of work on Quick Messages.

angus

I’ve added a feature which covers the use case previously mentioned (i.e. omission of a rating from the first post in a ratings topic), and also lets any user remove a rating entirely from a previous post in a ratings topic. Complete removal of a previous rating allows the user to rate in another post on that topic if they so wish.

https://github.com/angusmcleod/discourse-ratings/commit/c6ddc5a6546a594d7fa54bc5ce0238b02b0b7471

meglio

Is it possible to customize the “rating” tag to be any other existing tag of my selection?

angus

Hey, that’s number ‘4’ on my list of to dos. As you’ve seen on the topics for my other plugins where you have posted I have a few ‘to dos’ on my plate at the moment, so it’ll be a little while before I add that. But I am happy to accept a PR in the meantime.

envieme

Hey I love this plugin. Thanks for the good work. How about showing the rating on hover over the stars in each topic / posts? For example can show 3.5 or 4.2 numbers based on average rating. I have the Show exact average rating setting turned on.

angus

Sorry for the slow reply, I’ve been away.

Just to clarify, you are seeing the numerical average next to the topic rating right?

Could you show me a mockup or an example of what you have in mind? Cheers.

envieme

Yes, I see the average. That’s fine. What I have in mind is a Amazon.com like hover on small title popup showing the average on the main topics list view. In that screen you see a rating but on hover does not show the average. For example, a 3.5 rating is showing as 4 stars and on hover does not give out the average. I have to enter that topic to view the average. Understand it is not a big deal to have it as it is, just thought since we are accustomed to hovering over star ratings on many websites to see the average score, it may be a good feature to implement for habitual reasons.

envieme

When the topic creator has chosen no rating for a topic, why don’t we suppress the need to either add a rating or uncheck the box for replies? We can just hide the ratings field for the replies right?

angus

I’ve added exact averages to topic list items in the same format as in the topic title.

I didn’t do the Amazon-style hover (yet) because a hover element typically holds more content than just a single number (unless it’s a tooltip), and I’ll need to decide what else to include there first.

One option is to add the percentages for the different star options like Amazon does (see below).

Also, I had a brief look around at other popular sites using star ratings. It seems a majority display the number of ratings after the stars, with a minority showing the exact average. Not many show anything on hover.

Were there any other specific examples you had in mind?

angus

Could you give a little more info for this scenario:

  1. Is the topic in a category with ratings turned on and/or has a ‘rating’ tag?

  2. Which ratings ‘field’ are we hiding?

envieme

Yes, the topic is in a category with ratings turned on. I will give you an example.

As a topic creator, I post a new topic under this category but uncheck ratings while posting it.

Now another user is replying to this topic without ratings (but under a category with ratings enabled)

The user has to now again either uncheck ratings while posting his reply or has to add a rating.

I wonder if we can (or should) suppress the need to add/uncheck a rating for replies to a topic which the owner of the topic has not set ratings to. I cannot think of any scenario where it may be needed to add a rating to a reply for an original topic without ratings.

repz

Hi!

I triied to install this plugin but seems like something is wrong, i can’t rate a topic and got this in error logs :slight_smile:

Error: Could not find module `discourse/helpers/register-unbound` imported from `discourse/plugins/discourse-ratings/discourse/initializers/ratings-edits`
    at o (https://forum.hsfactory.net/assets/vendor-6c83cefb781b3fa325bff76e9ba637bf719260cc7353ee0179cd706e79535999.js:1:16235)
    at i (https://forum.hsfactory.net/assets/vendor-6c83cefb781b3fa325bff76e9ba637bf719260cc7353ee0179cd706e79535999.js:1:16160)
    at n.state (https://forum.hsfactory.net/assets/vendor-6c83cefb781b3fa325bff76e9ba637bf719260cc7353ee0179cd706e79535999.js:1:17303)
    at e (https://forum.hsfactory.net/assets/vendor-6c83cefb781b3fa325bff76e9ba637bf719260cc7353ee0179cd706e79535999.js:1:15619)
    at requireModule (https://forum.hsfactory.net/assets/vendor-6c83cefb781b3fa325bff76e9ba637bf719260cc7353ee0179cd706e79535999.js:1:17288)
    at https://forum.hsfactory.net/assets/application-e93a5eb8d40d078353f1408a62dde9404648a0ef8e6cdf28483c04667dd5e36b.js:1:3894
    at Array.forEach (native)
    at window.Discourse.Ember.Application.extend.start (https://forum.hsfactory.net/assets/application-e93a5eb8d40d078353f1408a62dde9404648a0ef8e6cdf28483c04667dd5e36b.js:1:3837)
    at https://forum.hsfactory.net/:487:13
angus

@repz I just updated this plugin to work with the latest Discourse code. Please try again. Thanks.

repz

@angus working like a charm!

Thanks a lot :wink:

simon

This is great! I’d like to use it with the Discourse WordPress plugin so that WooCommerce (a WordPress ecommerce plugin) product reviews can be written on Discourse. Does anyone have any ideas on what needs to be done to return the rating and average_rating fields with the information returned from wordpress.json?


Edit:
I’ve got it working by returning the topic custom fields through the TopicViewWordpressSerializer and the post custom fields through the PostWordpressSerializer.

angus

Nice. Let me know if you have any other issues.

doserved

Hi. I got the following fatal error after rebuilding the app. I am running v1.6.0.beta9 +16. No rating box shows up when creating new topics or posts. Thanks

NoMethodError (undefined method custom_fields' for nil:NilClass) /var/www/discourse/plugins/discourse-ratings/plugin.rb:55:in calculate_topic_average’

angus

@doserved I just made a slight change, could you test it again? If it fails again please post as much of the log here as possible.

Thanks.

doserved

Angus,

It works now. Thanks for making the fix!

David

dax

Italian translation
client.it.yml (469 Bytes)

angus

Cool, if you make it a PR I’ll add it to the repo.

11147

Hi:

Thanks for your efforts.

I have tried to install stable version and master version on the newest discourse version, it cannot work for me. Can this plugin compatible with the discourse master version which has already tag plugin embeded. 

Looking forward to your reply.

angus

Hey, are you seeing any errors in the console? or in /logs ?

11147

I just download the code from github into directory discourse/plugins/.

I use the develoment environment.

11147

11147

but when posting, can not see rating widget.

Could you provide the discourse version which tested successfully with this plugin?

Or should I modify some config in the develoment env after download the code into plugins folder?

I have tried to make rating work for me.

Thanks very much!

There is also one problem, my star is disappeared. LOL

11147

Hi:

I have tested topic preview list plugin V2 and topic rating plugin, both of them worked abnormal with discourse V1.6.0.
About topic preview list plugin V2, I can not see thumb picture when post has image. But if setting the default image, I can see that thumb picture.

angus

@11147 When developing plugins on your local you need to do three things each time you install a new plugin to be sure you’re seeing the real plugin behavior:

  1. rm rf tmp in your root directory.

  2. Clear cached images and files in your browser.

  3. Run sidekiq.

If you do those things this plugin will work on your local.

For example:


smartwatchme

Did SEO friendly ratings ever make it in as a feature?

angus

I haven’t looked at that yet. I can take a look on the weekend.

Could you explain the existing Discourse behavior (I’ve never really investigated it in Discourse before), and how you expect ratings to fit into that, to give me a head start?

dax

Submitted a PR for italian translation (sorry for the delay).

ewanly

Thank you for this lovely plugin.

I think it would be better to round the rating number I’m getting it like this

ewanly


When creating a topic with rating, its giving an error:

and its cleans the topic’s edit widow from its edited contents. When I click [cancel] for the reply, then [Yes, abandon]. I see no topic added. But after I refresh the browser, I see that the topic has been created.


Then I tried to reply to that topic with another user, the same error, also with cancelling its still created. But this time without rating (another time created with rating). and when you cancel, its clear the rest of the window in the browser like this:


After browser refresh, you see the topic created (this time without rating but another time happened with rating).

From the same user I’d tried to reply again. Every time you got the error for sure!. This time its saved the rating:

When I’d tried another time. It’s allowed the second user to rate twice. At the above example it was by chance that the first reply got no rating.


Please inform me if any fix for these errors.

Note 1:
I’m using Discourse (1.7.0.beta6) at Digital Ocean Droplet, 2GB, Ubuntu 14.04

Note 2:
At the Admin/plugin/settings for this rating plugin, you are getting the list of all plugins’s settings! It would be nice to have only the plugin related settings listed.

angus

Hey thanks for the bug report! This was caused by a recent change in how the topic controller is included in the composer controller.

Now fixed.

angus

I’ve added a setting to allow multiple tags to be used to designate a ratings topic.

@zogstrip Could you wikify the first post of this topic? I can’t edit it anymore and would like to update the feature description. Thanks.

zogstrip

Your topic shall be Wikified :sparkles:

ewanly

Thank you @angus, I’m really happy to hear that you fixed it :slight_smile: :+1:

(I hope that you had a chance to round the number too)


Edit 1: I just updated the plugin. I found the followings:

  • The numbers still not rounded. if 3 users give 2, 2, 4 the ratings result became (2.3333333333333335) which is so eye catching!. Yes, you could hide it from the settings but then 2 of 5 stars is not giving a good idea as rating. Instead, putting (2.3) would be much better in my opinion.

  • The user after replying with Ratings, he could edit the reply but the rating change is not saved. Could be nice to allow the change in case if any user mistake correction.

  • The topic which had ratings stars, is listed without stars when the selected view desktop_category_page_style = Categories and Latest Topics (from Admin settings/basic setup/desktop category page style)

  • I loved the idea to be able to make the post/reply with rating enabled by adding a special triggering Tag :+1:

When reading your To do list, I’m so excited to see the followings done;

2.-Created a sorted topic list (highest to lowest) of all topics within a ratings category or with the ‘rating’ tag.
5.-Allow the user to choose the number of total stars in a rating.
6.-Allow the user to change the rating item image (i.e. use something other than stars).
7.-Add topic rating to page description in search results.

I wish I had the ability to help in coding :frowning: but at least I could offer to help in translating to Arabic and to Turkish languages. But I never did it before for a plugin, if you could show me where and how. I’ll be happy to contribute.

angus

I’m doing a refactor of this plugin at the moment. The logic is considerably outdated. I should be done in a day or so.

angus

I’ve finished the refactoring. The logic is still quite complex so there may be some remaining issues, but I’ve tested it a fair bit.

New or updated ratings will be rounded to the nearest decimal place. If you edit a post with a rating in an existing topic this will prompt the rating to update to a rounded number.

This bug is fixed.

There are no plugin outlets in that view yet, so this is not (yet) possible. Right @zogstrip?

zogstrip

Feel free to submit a PR to fix that :wink:

ewanly

Sorry its me again.

When I’m creating a regular topic (in a category settings unchecked for rating), if I select any tag for that topic, when clicking to create that topic I’m getting this error :

Notes:

  • There is no error logs
  • I have only one tag for rating as default and named “rating” (and I’m not using it in this topic creation)
  • This is happening with any chosen non-rating tag
  • When I’m getting this error, there is no rating check box or the stars showed. (as should be)
  • Even if I cleared the selected tag, I’m not able to create that topic anymore. I should cancel and recreate a new topic without touching the tagging field. Then no problems.
ewanly

Dear @angus,

Its been some days I didn’t get a response from you regarding my last reported bug. I know that’s your style is to come back with a solution :wink: and I like it. I’m just curious if you had a chance to put hands on it yet.

It’s been busy days for every body but this bug is preventing us from using Tags in our posts. Just inform me please, if it will take longer, I would uninstall the plugin till its fixed.

Luca

Your plugin is simply amazing!!!

I am thinking to an anonymous voting scenario.
Discourse already supports anonymous users, but it would be great to also allow blind voting:

  1. a user can only see his/her own votes
  2. administrators can/cannot see votes
    (configurable flag to also allow them to blind vote)
  3. when blind voting is disabled everyone can see votes

Voting and blind voting could have different configurable time frames (from start date to end date).

Votes and their average (both stars and number) can adopt the same permissions of the category/topic/comment/reply or can be set as invisible for users not logged in.

angus

@Luca interesting ideas!

Would you use this feature? What kind of situations can you see anonymous ratings being useful for?

This would be more applicable for voting per se as opposed to rating I think. I would first have to support voting. But there is already a native Discourse voting feature.

In what kind of situations can you see this being useful?

angus

Sorry, looks like I overlooked you bug report here. Are you still experiencing this issue?

ewanly

:slight_smile:

Yes, I’ve just tested now before I answer you, just in case its fixed with my recent rebuild but, problem still the same :frowning:

angus

Right. Just fixed it. Sorry for the delay here.

https://github.com/angusmcleod/discourse-ratings/commit/651d40be99c92cd904061b9d0249051a4c46199a

ewanly

Thank you! Its working fine now :sparkles:

ewanly

Dear @angus, till today everything were working just fine. After I’d installed Retort Plugin (@gdpelican), I’ve started to experience exactly the same bug again :scream:

(Again no error log to provide, I’m running the last versions of everything)

Please could you check on it. :four_leaf_clover:

dgadiraju

I just installed as per the instructions and I am getting this error.

angus

This plugin was broken by various discourse/ember updates. Just updated it.

https://github.com/angusmcleod/discourse-ratings/commit/d0157bf5095f9b7332a0d144cf8626bab2014d60

tophee

Grat plugin, thanks! I’m not sure why I did not see the option “Use topics in this category to rate things” at first, but when I just upgraded another plugin, it magically appeared…

Anyway, I have a feature request. Currently, when a user posts a topic in a category with rating activated and unticks “Add rating”, ratings are disabled for all subsequent posts in that topic. I don’t like that because I want to make sure that users are encouraged rate any post in the Marketplace category (the idea is that if you advertise a product or service in our forum, you have to accept to have it rated).

I see at least two ways of solving this:

  1. Add an option “Enforce ratings in this category” to the category settings which prevents topic creators from disabling “add rating”. If they don’t want to give a rating, they just leave it at “0 stars”
  2. Change the overall setup so that the OP does not get to decide whether replies to that topic can add a rating or not.
hnaseri

In recent updates, when I want to send a PM, there is a rating box like normal posts there, which I think it shouldn’t be.

angus

Thanks for reporting this. I recently made some changes to make this plugin interoperable with another plugin.

It should work as normal again.

hnaseri

Thank you very much. Is it possible to make average rating a float number? like 4.7?

angus

Yup. In fact the averages are already stored in the db rounded to 1 decimal place.

So this small change in the serializer should do the trick.

tophee

Are there any known issues with this plugin? I have had it installed for a while but never used it. Now when the first topic came up in a ratings-enabled category, it shows that rating is enabled under the topic title but when I reply, there is no way to actually submit a rating…

pfaffman

You can’t rate your own posts. Could that be it?

tophee

Good idea, but it’s not my own post. However, the topic owner created the post in a different category and I moved it. Maybe that has something to do with it?

cpradio

That is almost definitely it. As the same thing (used to?) throw off the topic-timers for auto close when moving from one category to another.

tophee

Let’s hope so. But I thought this has been fixed since a while:

I’ve definitely upgraded several times since that commit.

cpradio

That is not the same thing. This is Topic Ratings, not Polls. Topic Ratings might not be storing its data the same way Polls did.

tophee

I should have quoted the commit, which was not specific to any particular plugin

But you are still right that we have a different issue here because we are not moving custom fields out of a topic but we are moving a post into a new topic and that’s probably where the necessary custom fields are not being created/populated. At least that is my guess about what is happening here.

cpradio

Wait… you are still confusing me.

Are you talking about Polls or Topic Ratings? The PR you linked to was to specifically solve an issue with Polls, which stores its data in the custom_fields associated to a post.

Topic Ratings, stores ratings on a topic. I cannot say (without looking at the code), whether it is on the OP of the topic (thus associating it to the first post in a topic), or if there is another custom_fields variant that is specific for topics. If there is one specific to topics, then the PR you reference is irrelevant, as it only deals with posts.

Edit:
And looking at discourse-ratings/plugin.rb at main · paviliondev/discourse-ratings · GitHub, I see custom_fields referenced on posts, topics, and categories.

I have a feeling this deals with the topic custom fields. Which the referenced PR does not handle (or possibly the category)

angus

If you’re talking about this plugin and not polls:

  • A user can only submit one rating per topic. Once you’ve submitted your rating, you can still post in the topic, but the rating controls will not appear in the composer again.
  • Rating controls will appear in:
    1. Topics in a category with ratings enabled
    2. Topics with a ratings tag

As @cpradio said, this plugin uses both TopicCustomFields and PostCustomFields, however I can’t see any reason why moving a topic from one category to another would affect the ratings control visibility logic. The logic for deciding whether to show the ratings controls in the composer is dependent on CategoryCustomFields which are not being migrated in this case.

Topic and post custom fields are used to store ratings and average ratings, not to decide whether to show rating controls.

tophee

Yes, it’s ratings, not polls.

So are you saying this is the reason why I’m not seeing the ratings controls? No, I think you’re saying that the CustomCategoryFields are not being moved because I moved the post into rather than out of a rating category.

angus

Correct. CategoryCustomFields are not affected by topics being moved.

tbh, I haven’t tested the ratings client logic in the scenario you’re dealing with: moving an existing topic into a ratings category. I’ll take a look at that scenario this weekend. Thanks.

hnaseri

Can you add aggregated rating schema support to this plugin?

angus

If I understand correctly how schema.org works (which I’m still not sure I do, even after a using it a few times), the schema for AggregateRating will only work if it is within the scope of a ‘type’. It seems these scope types support AggregateRating:

As it (seems) to be type dependent, I’m not sure it makes sense to support it directly in this plugin as that would involve choosing a particular type, e.g. Product or Service. Not all users of this plugin will be using it for one particular type.

If someone else knows more about schemas and can confirm or deny this, that would help (@vinothkannans?)

You could still add schema support for AggregateRating within the scope of a particular type, by forking this plugin and adding a new file:

app/views/connectors/topic_header/aggregate_rating.html.erb

the contents of which would look something like one of the existing schema.org markup blocks in the topics/show.html.erb view e.g. the tags markup.

vinothkannans

We can add AggregateRating by default. In the allowed schema type list it have CreativeWork. In Discourse we are using DiscussionForumPosting as default schema type. It is a part of CreativeWork (CreativeWork > Article > SocialMediaPosting > DiscussionForumPosting). So it is 100% appropriate to use AggregateRating in topic ratings :+1:.

I manually tested this functionality in Google’s testing tool.

hnaseri

I cant edit post below a rating topic anymore.

angus

Thanks for the report. Bug fixed.

As per @vinothkannans’s advice, I’ve added aggregateRating as part of CreativeWork.

@vinothkannans You probably are already aware that Google’s structured data testing tool is complaining about the DiscussionForumPosting microdata for core Discourse topic views not having images. I’m not sure if that omission means the DiscussionForumPosting microdata blocks will be ignored?

vinothkannans

I think it needs some changes in both on your code and Discourse core. I will create a PR once it changed in core. For now okay :+1:

dalerka

Today I enabled this plugin for the first time on a pretty fresh discourse install and I don’t see the star-rating buttons in a reply box (composer) and I get the following error:
https://github.com/angusmcleod/discourse-ratings/issues/10

Update: after rebuilding the discourse app, I can no longer reproduce the TypeError... but I still don’t see the star-ratings buttons.

angus

Hey :). The addObject exception is actually unrelated to this plugin. It’s a Discourse exception. I’ve been meaning to report it.

As to the ratings buttons not appearing, I can’t repro it unfortunately. Can you send me some screenshots with the console open?

I tested it locally and on my sandbox here: https://discourse.angusmcleod.com.au/c/ratings

Composer:

Topic:

Topic List:

dalerka

Thanks! and sorry for undeserved attribution of a bug. :slight_smile:
On screenshots you can see no errors in the Console and no stars-buttons in the Composer or the average-rating div.

Update:

  1. The plugin works well if the post is created in the rating-enabled category initially. However it doesn’t work for the posts in such directory which have been created/edited before error-less installation of this plugin (i.e. I had some Discourse-related error on the server when initially installed this plugin, but after rebuild there was no error).

  2. Unfortunately the plugin doesn’t appear to be working for the posts initially created in a non-rating category, when those posts have been moved to a rating-enabled category, which is sad :’(

angus

Thanks for figuring that out. It should work for such ‘pre-existing’ topics now.

dalerka

Thank you that was fast! Indeed, now I can rate the pre-existing topics. However I can also place multiple ratings with the same user, which kind of allows for rating-abuse:

Tumi

Hi , nice plugin

It is possible to create a ranking of this ratings ?

For example i wanna to show the most importand topic from all category or selected in admin menu
For example i want to show on the sidebar Top 10 best rating topic from category X and category Y
It is possiible ?
It would be perfect if the top post will depend on Number of stars + number of votes (quality ratio)

angus

Given enough time, everything breaks, aka entropy … fixed as well :slight_smile:

angus

Hey

Yes, it’s possible. In a separate plugin you could add a new topic list that sorts topics based on the average_rating topic custom field.

Here’s an example of how to create a new topic list that is sorted by a custom field:

Well, you’ll need a sidebar first. Then a widget that has a topic list in it. Here’s some I prepared earlier:

https://github.com/angusmcleod/discourse-layouts

So all you need to do is change the topic list in the layouts-topic-list widget to the topic list you created in your new plugin.

  1. Follow the beginners guide to creating a plugin

  2. Add the layouts plugin with the topic list widget

  3. Copy / paste the new topic list code I’ve linked above

  4. Change a few variable names and urls in the topic list widget and the topic list code.

meglio

For some reason, ratings checkbox is now shown in some composers, and users don’t understand why?

I never configured it or turned on anything like that.

meglio

I think I caught it: it is shown when EDITING messages. Even if it’s turned off.

angus

Thanks for the report :+1: Fixed.

dalerka

Hey, Santa Angus! Got some room in your busy schedule? :slight_smile:

[feature request] Show the count of reviews along with the avg score · Issue #11 · paviliondev/discourse-ratings · GitHub

angus

Added :santa: Setting is rating_show_count; default is false.

See further: https://discourse.angusmcleod.com.au/t/the-400-blows-truffaut/151

dalerka

Dear Santa, thank you very much! I always believed you were real :blush:

Tumi

Thanks for Your time. Ok i will learn how to do it all becouse im not a programmer… Need some time. Pls tell me - should i learn a ruby laungage or not really ? Should i know somethink more ? How to learn it as fast as it possible (not for be a pro - just for myself needs)

angus

@dalerka @hnaseri As discussed, I’ve updated the average / count style. It now looks like this:

54 PM

Both the Amazon style and the use of an emoji has issues. I think it’s best we keep it simple.

Thanks for your suggestions :+1:

dalerka

Thanks, Angus! I totally agree with you on KISS, but genuinely curious if you could expand on issues with Amazon’s approach. Is it about UX or Discourse-related?

angus

There aren’t any inherent flaws with Amazon’s rating UI/UX or any inherent limitations in Discourse, it would just take considerably more work to achieve the same result in this plugin and there would be various UX tweaks to their approach and decisions that you’d need to make.

Effectively it would be a new feature-set rather than a UI tweak, which is all that is required for now.

Off the top of my head, some things you’d need to do would be:

  1. Fractional stars, which would entail a refactor of the CSS. Albeit, this has the minor caveat that the fractional star in Amazon typically does not represent the actual average. See the screenshot below for an example (4.5 according to the stars, 4.7 according to the text)

  2. Provide the rating breakdown from the server and set up the UI so that it’s consistent with the Discourse UI, e.g. the bar chart would be a new UI element you’d need to build specifically for this.

  3. Interactivity of the rating breakdown, i.e. in Amazon if you click on one of the ratings you see just those ratings. Once a rating breakdown is provided, the ability to filter the rating posts by rating is the natural next step.

Not to say that I wouldn’t want to do each of all of these things at some point, just not right now, particularly as these kind of features get more relevant when you’re dealing with consistently large volume of ratings, which (as far as I’m aware) we’re yet to see with this plugin.

Boogs

This is awesome!

I’ve been thinking how awesome a Discourse / ecommerce integration would be. There are heaps of third-party reviews systems, but they all to some extent take the SEO and community engagement away from your site.

IMO, this plugin + your Q&A plugin would work very nicely! Basically you could relate the post to a particular product (from say a CSV or XML product feed or ecommerce CMS’s API). I guess the ratings threads would need a way to restrict topic creation so that there is only one thread per product.

On the ecommerce CMS side you’d have some kind of widget that shows a snippet of the ratings and Q&A’s for that product, similar to the WP / Discourse integration.

Thoughts?

angus

Yes that’s all doable. I haven’t been doing a lot of work on the QnA plugin, so if you want to use that in a serious way you’ll need to take a close look at it and test its functionality thoroughly.

Not entirely sure what you mean here, but this would seem to be something your moderators would handle, at least initially.

Sounds a bit like you may want to also use Topic List Previews.

dalerka

:crazy_face: Today I updated the plugin to (fd25572) and the Rating-stars disappeared from items of topics list view and on suggested topics list (i.e. I can still see the stars on a topic page).

I cannot find any elements with .topic-rating class in the source code of the topic list view. Is it a bug or is there a new setting I should enable?

angus

Yup, minor bug. It will work as normal now. Thanks for reporting.

dalerka

Thanks! So, (just for the record) previously the plugin rendered the .topic-rating nested under .social-footer and now it renders nested under .topic-title (in a topic-list view).

Now, I also see that in the suggested topics list sometimes (randomly) the .topic-rating and .topic-excerpt elements don’t get rendered at all. Any ideas why?

UPDATE: Don’t know why, but the later issue with excerpt and rating not rendering randomly has suddenly disappeared. Magic :smile:

angus

Hm yeah. This is all about plugin outlet placement in the topic list item template(s). The Ratings plugin is now using the topic-list-after-title outlet.

I’ve handled the case you’re referring to. For social style, the plugin outlet will render content in the gutter now.

https://github.com/angusmcleod/discourse-topic-previews/commit/2f3d069d93e988f784bcacd64aac8c77a4fc23ad

dalerka

Haha, I’m sorry, didn’t mean to distract you.
The after-title position was actually preferable for me (even with Social style). My point was to help other people fix styling (target the right element). I made few CSS changes and removed hiding an extra middot.

So, if possible can you keep it the new way (i.e. rendering at after-title)?

UPDATE: Also with the recent update the .topic-ratings element doesn’t render on mobile (with social style topic list enabled). So, to keep it simple, maybe just render after title?

angus

I’ve fixed the mobile outlet, but I’m sorry, I think it makes more sense for the social style to have the outlet in the footer by default - it’s where all the other topic info is in that style.

If you want to move the element on your instance (i.e. more than just using CSS), you can use jQuery:

Ember.run.scheduleOnce('afterRender', () => {
  const $topicRating = $('.topic-rating');
  const $target = $(target);
  $topicRating.appendTo($target);
});

This will make the topic-rating element the first child of whatever container you want to put it in.

dalerka

No, problem at all! As long as things are kept consistent across updates :slight_smile:
Thank you for all your hard work!

Anshul_TM

Hey @angus,

I want to extend this to allow for multiple ratings instead of just one.
e.g. in my case Train reviews can include punctuality, cleanliness, food.

I’ve cloned the repo and exploring the code, a few pointers will be very helpful.

angus

Do you mean multiple ratings on one topic? Yes that could be done I suppose. Basically, you’ll need to add in additional custom fields, wherever the current rating custom fields are. And some conditional logic to handle the calculation of the average separately for each type.

For example, you may end up with something like this for saving the rating when a post is created:

  DiscourseEvent.on(:post_created) do |post, opts, user|
    if opts[:rating] || opts[:rating_type2]
      post.custom_fields['rating'] = opts[:rating] if opts[:rating]
      post.custom_fields['rating_type2'] = opts[:rating_type2] if opts[:rating_type2]
      post.custom_fields["rating_weight"] = 1
      post.save_custom_fields(true)
      RatingsHelper.handle_rating_update(post, opts)
    end
    ///

Then add some conditional logic in handle_rating_update to calculate averages and push those averages to the topic, for each type of rating.

parisa

The newest version makes opening the rating topic too slow. for example if other topics would open in two seconds, rating topic opens in 5 seconds.

on the other hand is there an option to remove stars from below topic title and just let them be inside the topic?

angus

Can you give me an example of this? In my own testing on localhost, and on https://discourse.angusmcleod.com.au, rating topics load at the same speed as any other topic.

I’ve added settings for the average ratings in the topic and in the topic list:

parisa

here is all our rating topics.

you can open this one since it is the most rated topic.

angus

The slow load of that topic may have more to do with it having 4542 posts :slight_smile: That’s a very long topic.

Nevertheless, I’ve made some performance improvements. The first time you load the topic you won’t notice a difference, but subsequent loads may be faster, if the ratings plugin is having any effect on the load time.

https://github.com/angusmcleod/discourse-ratings/commit/55dd33988d3fd9b7b4368d7618d19481176de13f

Let me know how it goes.

parisa

but as I told previously, it was ok until some days ago I updated both discourse and this plugin to the latest version.

parisa

I updated the plugin, but unfortunately it didn’t have any effect imo. What is it that takes the most process in this plugin?

If it is calculating the average rating, maybe you could cache the value for, lets say, one day perhaps?

It could be a disaster for rating topics like mine that rapidly grows in number of posts.

However again I need to say that this problem occurred very recently in my last update (discourse core + all plugin). So maybe its because of one of your new commits, or even commits to the core discourse that caused the problem?

angus

Aside from the changes I just made, none of my commits in the last few months to this plugin would have had an effect on performance. They were style and translation changes.

So if there has been a noticeable deterioration in performance in those very large topics in the last few days, it is probably something core related.

I can take a look in more detail at what might have caused this in core Discourse later this week, but you should raise this with the Discourse team.

*edit @parisa You may want to have a read of this topic: Performance improvements on long topics?. Another host with a topic of a similar size (i.e. 4.5K posts) has the same issue:

parisa

Yes you are right. I think I found the problem. Its the new mixed text direction feature.

frold

Quick question: To rate a topic do you need to post in it - or can you rate without making a reply to the topic?

Im asking as I would like to add a book review section to my site. Im not sure what is best: being able to add star rating with or without adding a reply/reason… :thinking:

frold

Now I have installed this great plugin.

I have a question to the styling

  1. “No ratings yet”
    I would like that if it is rated then show the stars. If not, show nothing. I dont want a list of “No ratings yet”, is that possible?

  2. Could “7” and “17” in the blue circle is normally placed after the title. Is that possible?

Mittineague

Maybe instead of not showing “no ratings yet” it would be better to show a type of “be the first to rate”?

angus

I will take at look at both issues tomorrow.

frold

Else show the icon for no stars yet (5 empty stars).

The mix of text and grafic is not eye candy, I think :smiley:

angus

I’ve removed the ‘No ratings yet’ label from the topic list. As you allude, it’s not really necessary there. That also fixes the unread count alignment

Remove no_ratings label from topic list · paviliondev/discourse-ratings@f25c9f3 · GitHub

It’s still in the topic itself.

You can edit the text itself by editing the translation files in Admin > Customize > Text Content. Search for “no_ratings”.

frold

Much better :smiley:

Before

Now

But there is still a line break from title to “unread posts” - the blue circle

This is the look in a category where you havent enable ratings

But much better :+1:

frold

Any plans to solve this?

angus

Apologies, this got left off my list. Now fixed:

frold

Thanks

And the rich data thing is neat!! Thanks

44

Based on this

thaidb

How add rating effect all category?

angus

This plugin has to be turned on for each category you want to use it in. I don’t think it would make sense to have a site-wide setting.

Ivan_Rapekas

Is it possible to have an option to enable this plugin only for group, staff for instance? Regular users should not see stars anyway.

angus

Do you mean only allow a specific group to add stars to a post?

Or only allow a specific group to see stars on posts at all? Or both?

Do non-group users still have access to the ratings topics at all in your scenario?

Ivan_Rapekas

Hi @angus, thanks for reply!
My case is:

  1. Only specific group (staff would be enough, let it be) is allowed to add/remove stars
  2. Only staff can see stars
  3. Non-group users should not see any ratings (as this plugin not installed).

The scenario is necessary to rate topics and posts by staff members. It will allow to gather statistics (data explore plugin is used) about the most important conversations, thoughts directions or people. This can help to improve services that we provide to our community via forum.

Unfortunately I had not success to develop this function by myself…

angus

Sorry, just to be sure I’m understanding you, staff will be rating other people’s (normal users) posts?

Ivan_Rapekas

No problem. Yes, staff will rate users’ posts. Also staff users will rate posts the same way both in private categories and categories shared between other registered users.

Francois_Douville

Great plugin again! :smiley:

  1. Is it possible to hide “no ratings yet” when there is no rating?

  2. Is it possible to have the choice to set, by default, no rating? Now it is by default mark to set a rating. Like this : 22 but with stars like this (without mark) image

angus

Yup, I’ll tackle these a bit later in the week.

Task List

  1. Hide “no ratings” when there is no rating.

  2. Add a setting to not check add a rating by default.

  3. Add a ratings-specific topic list that lists topics by average rating.

  4. Improve the rspec and unit tests.

alxsal

I have a topic for which I unchecked the “Add à rating” box. However, each time I edit this topic, the “Add a topic” box appears checked again, and I have to uncheck it each time.
Is it possible to keep track of the fact that the box was chosen unchecked upon creation of the topic, and keep this preference by default when editing that topic ?

angus

This should fix your issue.

parisa

I’m having the following error with rating topics:

### Message

NoMethodError (undefined method `to_i' for [3730, 3730]:Array Did you mean? to_s to_a to_h) /var/www/discourse/plugins/discourse-ratings/plugin.rb:104:in `rating_count'

### Backtrace

/var/www/discourse/plugins/discourse-ratings/plugin.rb:104:in `rating_count' /var/www/discourse/plugins/discourse-ratings/plugin.rb:145:in `has_ratings' /var/www/discourse/plugins/discourse-ratings/plugin.rb:129:in `include_average_rating?' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:375:in `include?' (eval):58:in `_fast_attributes' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:468:in `rescue in attributes' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:455:in `attributes' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:480:in `_serializable_hash' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:359:in `serializable_hash' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:347:in `as_json' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/json/encoding.rb:35:in `encode' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/json/encoding.rb:22:in `encode' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/core_ext/object/json.rb:41:in `to_json' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:331:in `to_json' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/multi_json-1.13.1/lib/multi_json/adapter.rb:25:in `dump' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/multi_json-1.13.1/lib/multi_json.rb:139:in `dump' /var/www/discourse/app/controllers/application_controller.rb:395:in `render_json_dump' /var/www/discourse/app/controllers/topics_controller.rb:777:in `block (2 levels) in perform_show_response' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/mime_responds.rb:203:in `respond_to' /var/www/discourse/app/controllers/topics_controller.rb:769:in `perform_show_response' /var/www/discourse/app/controllers/topics_controller.rb:128:in `show' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:194:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/rendering.rb:30:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:42:in `block in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:132:in `run_callbacks' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:41:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/rescue.rb:22:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in `block in instrument' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in `instrument' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in `instrument' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:32:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal/params_wrapper.rb:256:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.0/lib/active_record/railties/controller_runtime.rb:24:in `process_action' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:134:in `process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionview-5.2.0/lib/action_view/rendering.rb:32:in `process' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiling_methods.rb:78:in `block in profile_method' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:191:in `dispatch' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:252:in `dispatch' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:52:in `dispatch' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:34:in `serve' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:52:in `block in serve' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in `each' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in `serve' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:840:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-protection-2.0.2/lib/rack/protection/frame_options.rb:31:in `call' /var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:24:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb:15:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:25:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/head.rb:12:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/http/content_security_policy.rb:18:in `call' /var/www/discourse/lib/middleware/anonymous_cache.rb:200:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in `context' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/cookies.rb:670:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:98:in `run_callbacks' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:26:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/logster-1.2.9/lib/logster/middleware/reporter.rb:31:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:38:in `call_app' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:28:in `call' /var/www/discourse/config/initializers/100-quiet_logger.rb:16:in `call' /var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/remote_ip.rb:81:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/request_id.rb:27:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiler.rb:174:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/message_bus-2.1.5/lib/message_bus/rack/middleware.rb:63:in `call' /var/www/discourse/lib/middleware/request_tracker.rb:186:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:524:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in `public_send' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in `method_missing' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in `block in call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `each' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in `call' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:606:in `process_client' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:701:in `worker_loop' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:549:in `spawn_missing_workers' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:563:in `maintain_worker_count' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:293:in `join' /var/www/discourse/vendor/bundle/ruby/2.4.0/gems/unicorn-5.4.0/bin/unicorn:126:in `<top (required)>' /var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in `load' /var/www/discourse/vendor/bundle/ruby/2.4.0/bin/unicorn:23:in `<main>'

### Env

hostname talk-app
process_id 2810
application_version 4b2e42757d00556468ec82047a8fcc723b087e1a
HTTP_HOST talk.zabanshenas.com
REQUEST_URI /t/540.json?api_key=1d4d600b283c1e2b3f7092ccbc51ba8fabe0040991d57f978b30bccef1695b95&api_username=pompi
REQUEST_METHOD GET
HTTP_ACCEPT */*
HTTP_X_FORWARDED_FOR 5.114.215.8, 5.114.215.8
HTTP_X_REAL_IP 5.114.215.8
username pompi
params api_key 1d4d600b283c1e2b3f7092ccbc51ba8fabe0040991d57f978b30bccef1695b95
--- --- --- ---
--- ---
api_username pompi

angus

This is a strange error. It should not be possible. Nevertheless, I’ve added some logic that handles it. Please update and it should work.

sam

I have seen this before. I feel there is an internal bug we have where we should be allowed to explicitly register a type and then have core enforce it on the way in and the way out.

angus

Yeah, I was thinking the same.

grahamtrump

Today the rating plugin make my site down.

NoMethodError (undefined method to_f' for ["4.0", "4.0"]:Array) /var/www/discourse/plugins/discourse-ratings/plugin.rb:92:in average_rating’

Oops

The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience.

Detailed information about the error was logged, and an automatic notification generated. We’ll take a look at it.

I must remove it. :frowning:

angus

Sorry for the issue. It’s a similar issue to the one reported above. I’ve added the same fix.

https://github.com/angusmcleod/discourse-ratings/commit/7c94c7a226580088da14e887a7268363252128d3

grahamtrump

fix for my error??? or for what error?

angus

It should work for you now

grahamtrump

OK, I will try again and feedback to you soon. :smiley:

grahamtrump

Site running, but with error log

ActionController::ParameterMissing (param is missing or the value is empty: rating) /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/strong_parameters.rb:4

Summary

/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/strong_parameters.rb:443:in require' /var/www/discourse/plugins/discourse-ratings/controllers/rating.rb:4:in rate’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/basic_implicit_render.rb:6:in send_action' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:194:in process_action’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/rendering.rb:30:in process_action' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:42:in block in process_action’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:132:in run_callbacks' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/callbacks.rb:41:in process_action’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/rescue.rb:22:in process_action' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:34:in block in process_action’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in block in instrument' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications/instrumenter.rb:23:in instrument’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/notifications.rb:168:in instrument' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/instrumentation.rb:32:in process_action’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal/params_wrapper.rb:256:in process_action' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/railties/controller_runtime.rb:24:in process_action’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/abstract_controller/base.rb:134:in process' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionview-5.2.0/lib/action_view/rendering.rb:32:in process’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiling_methods.rb:78:in block in profile_method' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:191:in dispatch’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_controller/metal.rb:252:in dispatch' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:52:in dispatch’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:34:in serve' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:52:in block in serve’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in each' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in serve’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:840:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/engine.rb:524:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in public_send' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in method_missing’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/mapper.rb:19:in block in &lt;class:Constraints&gt;' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/mapper.rb:48:in serve’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:52:in block in serve' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in each’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/journey/router.rb:35:in serve' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/routing/route_set.rb:840:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.3/lib/rack/protection/frame_options.rb:31:in call' /var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:24:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/tempfile_reaper.rb:15:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/conditional_get.rb:38:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/head.rb:12:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/http/content_security_policy.rb:18:in call’ /var/www/discourse/lib/middleware/anonymous_cache.rb:200:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:232:in context’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/session/abstract/id.rb:226:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/cookies.rb:670:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:28:in block in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.0/lib/active_support/callbacks.rb:98:in run_callbacks’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/callbacks.rb:26:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:61:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/show_exceptions.rb:33:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/logster-1.2.9/lib/logster/middleware/reporter.rb:31:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:38:in call_app' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/rack/logger.rb:28:in call’ /var/www/discourse/config/initializers/100-quiet_logger.rb:16:in call' /var/www/discourse/config/initializers/100-silence_logger.rb:29:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/remote_ip.rb:81:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/request_id.rb:27:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/method_override.rb:22:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack-5.2.0/lib/action_dispatch/middleware/executor.rb:14:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/sendfile.rb:111:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.0/lib/mini_profiler/profiler.rb:174:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/message_bus-2.1.5/lib/message_bus/rack/middleware.rb:63:in call' /var/www/discourse/lib/middleware/request_tracker.rb:186:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/engine.rb:524:in call' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in public_send’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties-5.2.0/lib/rails/railtie.rb:190:in method_missing' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:68:in block in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in each' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.5/lib/rack/urlmap.rb:53:in call’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:606:in process_client' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:701:in worker_loop’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:549:in spawn_missing_workers' /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/lib/unicorn/http_server.rb:142:in start’ /var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.0/bin/unicorn:126:in &lt;top (required)&gt;' /var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in load’ /var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `<main>’

angus

I’m surprised that hasn’t come up before. I’ve fixed that too:

https://github.com/angusmcleod/discourse-ratings/commit/dd905b7e340920dfb0e6b87a91d31d10a37ab34e

Please give it another shot. Thanks for your patience.

p.s. When you post a error log it’s best to use the Hide Details feature, so the log doesn’t take up a lot of space.

grahamtrump

so now I just run the ./launcher rebuild app again?

angus

Go to /admin/upgrade and upgrade the plugin from there.

grahamtrump

It’s OK now. Thank you.

grahamtrump

I got many error like this:

Unable to get property ‘getItem’ of undefined or null reference Url

TypeError: Unable to get property ‘getItem’ of undefined or null reference
at Anonymous function (https://abc.com/c/nhiep-anh:50:3)
at p (https://abc.com/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:2:9013)
at Anonymous function (https://abc.com/assets/ember_jquery-27e777857b8c0730dacfe09cb11711365d21a5db4f9ee0b85d494e4259cf6cda.js:2:9324)

angus

This is connected with the issue you described here. It is addressed here, and in subsequent commits.

FoohonPie

This plugin is nearly perfect for a project I’m working on. Thanks for all the work!

Is there any eta on #3 below? Is it a significant amount of work?

Thanks!

Arkshine

Hey,

I’m using both this plugin and Topic List Preview, and if I’m using the ‘Pinterest’ view from the later on the topics list, but the rating bit is not included for some reason (it does with the normal view or inside a topic). Did I miss something or is there a workaround to show them?

I tried to search, I could not find a single clue.

Thanks!

hosna

The latest discourse updates doesn’t work with this plugin.

angus

This has been fixed :sun_with_face:

https://github.com/angusmcleod/discourse-ratings/commit/1a65713382c63ed6c852519e7174309c424869f5

Merlls_Rizzini

These buttons (image above) are disappearing after last Discourse update if you use this plugin. Its happening for anyone besides me?

livc

Hi, any update?:smiley:

Ellibereth

@livc - I’ll check with angus, we’ll see if we can schedule it in if it hasn’t been done yet. :slight_smile:

Garrick

Hey guys. Wondering if anyone has a demo link I check with Google or if this is schema compatible?

Merlls_Rizzini

Any update on it? :smiley:

영광_임

hi
Thank you.
The plug-in has been installed.
But I do not see any starred features.

The Activate rating checkbox is not visible.

i’m sorry…
go to cd ~discourse/plugins discourse-rating remove
After
git clone GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things

I solved
thank you

but
Good at home.
The discourse installed in the company seems to have a problem.
plugin install after docker-compose can not restart
Error : 1. sudo docker logs 2fwk40482dw : fatal: Not a git repository (or any parent up to mount point /discourse)

angus

@영광_임 So you’ve solved the issue?

영광_임

yes…
at home
cd ~ discourse / plugins
git clone GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things
OK…

at company
git clone unable connect..
GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things download
Ctrl + c, Ctrl + v
rails s

Company can not resolve

영광_임

may be my company is ver discourse ver 1.8.0

영광_임

Is the discourse rating plugin not available in version 18.0?

merefield

I can probably jump in here.

Angus’ plug-ins are generally kept up to date to work with the latest tests-passed version of Discourse.

It’s probably a good idea if you update the company instance and not just for this reason, but to ensure you have the latest bug fixes, security patches and features.

영광_임

How is it confirmed!?

영광_임

Hi,
Thank you for creating the discourse-rating plug-in.
You are good
do you know?
discourse-rating Does it work with IE 11? I can not register by star.

Which parts should I fix?

angus

Hey! Just to clarify, you’re having issues with this plugin on IE 11? Could you describe the issue in some detail? Thanks.

영광_임

In Chrome, normal
IE 11 ver : New topic -> Enter rating -> No rating value

영광_임

IE 11 : There is no value attribute.

ex)
New Topic rating view(IE 11) : <input class="ember-view" id="ember1362" type="radio">
New Topic rating view(Chrome) :<input id="ember1996" type="radio" value="3" class="ember-view">

directory : discourse-ratings\assets\javascripts\discourse\templates\components
source : {{rating-star value=star rating=rating enabled=enabled}}<i></i>

value=star is Not applicable

angus

Ah interesting. Thanks for this. Would you mind making a bug report for this here:

https://thepavilion.io/w/bug-report

Thanks :+1:

영광_임

I tried to write.

See the url below

Owen_Neuber

Hi Angus, I love your plugin.

For my forum, I recently changed the setting to require a moderator to approve topics for new users. But during the approval process, the rating the user gave their topic disappears. Is there a way to prevent this memory loss?

This is the flow of my problem:

  1. A new user creates a new topic with a rating. They must wait for a moderator to approve their topic.
  2. The moderator sees the post that needs approval (in the /review window, no rating is present).
  3. The moderator approves the topic.
  4. On the site, both inside the topic and on the Latest page, no rating is associated to the topic.

Am I missing a setting somewhere or was the plugin not built to work with post approval?

Thank you!

angus

@Owen_Neuber Thanks for this feedback. This sounds like bug. I’m going to work on that @영광_임 posted later today, so I’ll take a look at this as well. Please post a full report here: https://thepavilion.io/w/bug-report

영광_임

Hi Angus, I love your plugin.
Is there a way to statistics the star score received for each user?
Which table should I look at?

I want to give a prize to a user who scores a lot of stars.

angus

Yes, ratings are stored in post_custom_fields as ‘rating’, so you just need to join post to post_custom_fields and select the user_id of post and value of post_custom_field’s with the name ‘rating’.

영광_임

Thank you
I like rating-plugin

Garrick

hey Angus. Just tried this by adding to app.yml and breaks the rebuild when I use the launcher. Is this added thru the admin settings or some other issue?

Garrick

Anyone know how to get this done right? I’ve tried adding the whole section.

hooks: after_code: - exec: cd: $home/plugins cmd: - mkdir -p plugins - git clone https://github.com/angusmcleod/discourse-ratings.git

I tried adding just this

- mkdir -p plugins - git clone https://github.com/angusmcleod/discourse-ratings.git

I’ve tried just the normal way of -git clone GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things

No matter what I do it doesn’t allow the launcher to rebuild the app.

fzngagan

This is yaml syntax and it doesn’t allow tabs to begin with. There may be other issues but make sure you’re using spaces and not tabs for indents.

Garrick

Thanks. I copied and pasted it from the github so maybe that’s the reason. Should it be the full section added or just the git clone part?

fzngagan

Check this out.

Garrick

Yeah that’s just the standard. I tried that. Where I’m guessing my issue is with the -mkdir -p plugins line.

fzngagan

Yes. you don’t need to do that.

Garrick

Ok so heres the error i get

I, [2019-08-27T09:33:32.898647 #20]  INFO -- : 
I, [2019-08-27T09:33:32.898807 #20]  INFO -- : > cd /var/www/discourse/plugins && git clone https://github.com/angusmcleod/discourse-ratings.git
Cloning into 'discourse-ratings'...
I, [2019-08-27T09:33:35.337452 #20]  INFO -- : 
I, [2019-08-27T09:33:35.337768 #20]  INFO -- : > cp /var/www/discourse/config/nginx.sample.conf /etc/nginx/conf.d/discourse.conf
I, [2019-08-27T09:33:35.341827 #20]  INFO -- : 
I, [2019-08-27T09:33:35.342189 #20]  INFO -- : > rm /etc/nginx/sites-enabled/default
I, [2019-08-27T09:33:35.344659 #20]  INFO -- : 
I, [2019-08-27T09:33:35.344783 #20]  INFO -- : > mkdir -p /var/nginx/cache
I, [2019-08-27T09:33:35.347471 #20]  INFO -- : 
I, [2019-08-27T09:33:35.348471 #20]  INFO -- : Replacing pid /run/nginx.pid; with daemon off; in /etc/nginx/nginx.conf
I, [2019-08-27T09:33:35.348857 #20]  INFO -- : Replacing (?m-ix:upstream[^\}]+\}) with upstream discourse { server 127.0.0.1:3000; } in /etc/nginx/conf.d/discourse.conf
I, [2019-08-27T09:33:35.349118 #20]  INFO -- : Replacing (?-mix:server_name.+$) with server_name _ ; in /etc/nginx/conf.d/discourse.conf
I, [2019-08-27T09:33:35.349463 #20]  INFO -- : Replacing (?-mix:client_max_body_size.+$) with client_max_body_size $upload_size ; in /etc/nginx/conf.d/discourse.conf
I, [2019-08-27T09:33:35.349744 #20]  INFO -- : > echo "done configuring web"
I, [2019-08-27T09:33:35.352366 #20]  INFO -- : done configuring web

I, [2019-08-27T09:33:35.352807 #20]  INFO -- : > cd /var/www/discourse && gem update bundler
I, [2019-08-27T09:33:40.884054 #20]  INFO -- : Updating installed gems
Nothing to update

I, [2019-08-27T09:33:40.884237 #20]  INFO -- : > cd /var/www/discourse && find /var/www/discourse ! -user discourse -exec chown discourse {} \+
chown: cannot dereference '/var/www/discourse/plugins/discourse-ratings/discourse-ratings': No such file or directory
I, [2019-08-27T09:33:42.396049 #20]  INFO -- : 
I, [2019-08-27T09:33:42.396498 #20]  INFO -- : Terminating async processes
I, [2019-08-27T09:33:42.396661 #20]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main pid: 74
I, [2019-08-27T09:33:42.396733 #20]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 191
191:signal-handler (1566898422) Received SIGTERM scheduling shutdown...
2019-08-27 09:33:42.397 UTC [74] LOG:  received fast shutdown request
2019-08-27 09:33:42.418 UTC [74] LOG:  aborting any active transactions
2019-08-27 09:33:42.424 UTC [74] LOG:  worker process: logical replication launcher (PID 83) exited with exit code 1
2019-08-27 09:33:42.424 UTC [78] LOG:  shutting down
2019-08-27 09:33:42.440 UTC [74] LOG:  database system is shut down
191:M 27 Aug 2019 09:33:42.447 # User requested shutdown...
191:M 27 Aug 2019 09:33:42.447 * Saving the final RDB snapshot before exiting.
191:M 27 Aug 2019 09:33:42.880 * DB saved on disk
191:M 27 Aug 2019 09:33:42.880 # Redis is now ready to exit, bye bye...


FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && find /var/www/discourse ! -user discourse -exec chown discourse {} \+ failed with return #<Process::Status: pid 360 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"web", "cmd"=>["gem update bundler", "find $home ! -user discourse -exec chown discourse {} \\+"]}
94c90ca9425cc301a5b050a68e890c937c9a70c79197f7afeec1ef1cc6ff06d9
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
fzngagan

@angus I think its related to the plugin. I can repro that.

angus

@Garrick Sorry for the slow response here. I just pushed a fix. I also moved the repository, so before rebuilding again, please update the link to

https://github.com/paviliondev/discourse-ratings.git

The old link will still work, but better to have the actual one. Let me know how that goes.

Garrick

Thanks @angus . Just tried it and worked fine. Thanka again!

GuilhermeBac

These buttons are disappearing when activating the plugin:

My app.yml
cd: $home/plugins
cmd:
- git clone GitHub - discourse/docker_manager: Plugin for use with discourse docker image
- git clone GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things

Just installed discourse yesterday

Mahesh_Tirthakar

Sir , I have installed 2.4.0.beta4 vesion of Discourse. I have installed two plugins discourse-rating (GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things) and discourse-topic-preview (GitHub - merefield/discourse-topic-previews-sidecar: A Discourse plugin that complements the Topic Previews Theme Component to add features) . we have developed post badge plugin. all these plugins working fine in v2.4.0.beta2 +342 version. but not in .4.0.beta4 vesion. Kindly look into this issues. if you want any more info then let me know

angus

Hey, @Mahesh_Tirthakar Please file a full bug report here: Bug Report

Siddhu_Dhangar

i have installed rating plugin in discourse development which is 2.4.0.beta5 but in docker discourse version it is not working ???

Siddhu_Dhangar
./launcher rebuild app

after rebuilding the docker discourse instance it is working. thanks.

Viki

Rating Shows before the Username in Mobile view
image

srikanth

How to sort the topics in home page by rating?

Bcat

aggregateRating Show on Thread when view-source and Google errors

<div itemscope itemtype="http://schema.org/CreativeWork">
  <span itemprop="name">TITLE</span>
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <span itemprop="ratingValue"></span>
    <span itemprop="ratingCount">0</span>
  </div>
</div>

Category is disable Rating.

When check element is aggregateRating empty. How to remove when view-source

Bcat

Do you think it’s time to move on : CreativeWorkSeries @angus

{
    "@context": "https://schema.org/",
    "@type": "CreativeWorkSeries",
    "name": "[title]",
    "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "[score]",
        "bestRating": "[best]",
        "ratingCount": "[count]"
    }
}
angus

@Bcat Thanks for the note. I’ll take a look at it later in the week.

art.ardolino

Hello,

I just installed this package and restarted several times, but I do not see the option to enable ratings under category settings. Any idea what could be wrong? I checked the plugin settings and ratings are enabled there. I’m not using tagging right now - just want to turn this on for certain categories.

Thanks for your help.

art.ardolino

Nevermind, I found it. The setting appears under “Category Lockdown” which is a different plugin I have installed, which is why I didn’t see it (see image below). I guess this plugin doesn’t create its own header for controls under the settings tab.

Bcat
<% if @topic_view.topic.average_rating != "" %>
<div itemscope itemtype="http://schema.org/CreativeWorkSeries">
  <span itemprop="name"><%= @topic_view.topic.title %></span>
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <span itemprop="ratingValue"><%= @topic_view.topic.average_rating %></span>
    <meta itemprop="bestRating" content="5"/>
    <span itemprop="ratingCount"><%= @topic_view.topic.posts.count { |p| !!p.custom_fields['rating'] } %></span>
  </div>
</div>
<% end %>

How to use if @topic_view.topic.average_rating != "" to show/hide this code?


Solved

<% if @topic_view.topic.average_rating && @topic_view.topic.posts.count %>
<div itemscope itemtype="http://schema.org/CreativeWorkSeries">
  <span itemprop="name"><%= @topic_view.topic.title %></span>
  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
    <span itemprop="ratingValue"><%= @topic_view.topic.average_rating %></span>
    <meta itemprop="bestRating" content="5"/> 
    <span itemprop="ratingCount"><%= @topic_view.topic.posts.count { |p| !!p.custom_fields['rating'] } %></span>
  </div>
</div>
<% end %>
fzngagan

OK, all users of Topic Ratings, please take note below.

How to safely update when using our plugins:

Pavilion’s update schedule

Topic Ratings is one of the Pavilion family of open source plugins.

Going forward, Pavilion will focus on ensuring compatibility of a core set of its plugins with Discourse Core tests-passed branch during the first 5 days of every month only.

Any bugs which arise because of an incompatibility will be addressed asap during this ‘supported period’, preferably by the 7th day. Low severity or Beta feature bugs may not be addressed by this date, but obvious things which are ‘breaking’ a forum should be resolved.

This new policy will come into effect 1st May 2020

Why we are introducing this policy

We have no control over changes in Discourse core. That is how it should be. However, as our plugins have grown and become more sophisticated, it is getting more and more burdensome to guarantee they are working with every update of Discourse. It’s becoming untenable to ensure immediate compatibility is maintained.

To give our developers breathing room so they can attend to other priorities in addition to plugin support we will no longer be guaranteeing compatibility with Discourse every day of the month.

This policy should also help you achieve more stability and give you more certainty over when you can more safely update.

How to perform your update

Aim to update your Production Discourse instance (both Discourse core and our plugins) in the first 5 days of every month. Notify us on the relevant Plugin Topic on Meta of any issues you encounter. You will get more focussed support from the Pavilion team on any issues with their plugins during this period.

You update your Production server outside of the first 5 days of the month at your own risk. If you do so and something breaks related to one of our plugins, we urge you to report it and in addition, and if appropriate, uninstall our plugin until it is resolved. Unfortunately we may not get around to fixing it until the next supported period at the beginning of the following month.

For even greater safety

Consider testing your update on your own staging server built from a back-up of your production site. This is especially important if your site is large, popular and/or part of a business.

You can switch this server off for the rest of the month so you don’t get charged for up-time. Use this opportunity to test out all basic functionality to identify any issues with plugins. Report all critical and high issues asap on the relevant plugin topic.

Using a staging site may allow you to have more discretion over when you update, but be aware of the relative lack of support in the latter part of the month.

Thanks for your understanding!

Arkshine

I’m not sure if the bug has been reported.

You can rate more than one time (related to can_rate), if a topic is loaded and your post with the rating is not included in that initial load.

It will work (can_rate to false) once the post with rating is loaded.

It’s quite problematic. What you said as comment there might be the reason

Is it possible to fix please?

fzngagan

Guys, we just pushed a new feature Multiple Ratings into master. Now you can rate a topic based on multiple criteria. Its a complete overhaul of the existing plugin. Please have a look at this guide for how to migrate your existing data to the new structure.

We suggest you take a backup before upgrading just to be extra careful.

We’ll look forward to your feedback.

fzngagan

Thanks for reporting the issue. We have almost completely revamped the plugin. Could you on the latest version whether you get this issue or not?

Arkshine

Is there some condition the checkbox to allow ratings to appear in the category settings?
After upgrading, I can’t see it anymore.

It’s a Discourse for testing stuff, and there are currently ratings enabled on ‘Uncategorized’ category.
Even though I can see the ratings, the option still doesn’t have appear in this category. Nor on a new category. All settings are enabled.

Also, another issue on Ratings tab. I removed the first category with None ; but it doesn’t seem possible to put it back. Also, not possible to Add Uncategorized with None.

fzngagan

Yes you need to do a few things mentioned in the documention link above.

Arkshine

Hmm, I get it. I assumed an option would be showed in the category settings but all happens now in Ratings tab.

That’s said, there is still a bug with Uncategorized category, it seems a first load, it seems the model behind is not selecting the category:

Once you select another category and select again Uncategorized, it works:

Arkshine

It doesn’t seem to work well.

Now I’ve enabled again the None with Uncateogrized, my existing ratings in this category doesn’t show.


I tried None in Site Feedback:

Once I create a new topic and save:

The rating is not saved:
image
image

Not sure if I’m missing something?


Another issue. When you associate a new category with rating types, you need to reload the page (F5) before creating a new topic. Because otherwise the ratings box doesn’t appear in composer.


Btw, I did not say it yet, but it’s really an awesome feature! Thanks!

fzngagan

I’ll try to repro the issues tomorrow and get back. Thanks for the feedback.

Touri

I updated today. Since the update I got a strange representation bug. With the user agent set to Safarie - iOS 13.3.1 - iPhone or iPodTouch (yes, it is still a thing) the ratings in the overview are shown twice. With all other user agents I tried it look normal.

Looking at the html there are two different divs created:

<div class="main-link">    
	<div class="rating-list">...</div>
	<a href="/t/mai-tai/395" class="title raw-link raw-topic-link" data-topic-id="395">Mai Tai</a>  
	<div class="rating-list">...</div>
</div>

We are on v2.5.0.beta7 +171.

If you want to take a look:
https://cocktailnerds.de/c/rezepte-guides/drinks/12

fzngagan

Just to be extra sure as you’re on a dev setup, did you run the db:migrate thing after installing the plugin?

Arkshine

It’s not a dev setup. it’s a normal installation hosted somewhere in a VPS. Originally, I installed the plugin with ProCourse Installer.

But because I thought the new version was not installed (same version), I removed ProCourse Installer and reinstalled it through app.yml.

The plugin did properly upgraded since I could see the ratings at first.
I can give you an admin user account to my test Discourse if you want to see the issue by yourself, let me know.

fzngagan

That would be very helpful for reference.

Arkshine

Hey, any news/status on the bug reports about the new version or/and any ETA of next updates?

fzngagan

I’m already working on a few fixes and the support period is also on…so you should see the fixes today/monday.

AntiMetaman

Can I specify which categories I want this to be enabled? I don’t want ratings for every topic only one.

Falco

Looks like yes, from the OP:

AntiMetaman

I just want ratings to be displayed at the top of the topic thread, not in each user’s post.

image

Otherwise, it looks like a double post. There only needs to be an average of all user’s ratings. This way ratings also stay anonymous.

Is there a way I can hide ratings on each post but show the average for the topic?

fzngagan

Interesting. So do you sugges user should only be able to see their own rating and the topics average at the top?

Actually, there might be a confusion. In this specific case of yours, no one has rated the topic except for the actual poster of the topic that’s why you see both of them to be similar.

AntiMetaman

I do. If someone is going through the thread and they see a lot of stars, it can look too cluttered and bad. I think at least for me, it is much cleaner to have the average star ratings at the top. The user should be able to see their own rating and that’s enough.

If someone were to give a bad rating and that is visible, then they would be exposed. In order to encourage the community to give honest ratings, they should be anonymous and only the user should be able to see their ratings only.

In the screenshot above, you see the original topic poster, so there’s only 1 post. It can be solved if an option is added that can be toggled called, “Hide ratings in other user’s posts”.

fzngagan

Thanks for the suggestion. I’m creating a feature request for this on our Pavilion instance. Let’s track this feature there.

Arkshine

It seems fixed for you. Did you do something?

EDIT: Nevermind, the bug bug appears only on mobile view actually (for him and me).

fzngagan

The mobile bug is fixed.

fzngagan

Guys, the support period is on. If you’ve updated your instance and found anything unusual, please report it on https://thepavilion.io/w/bug-report/ in the next 3 days. If you have a staging server, please do update and notify us if you see issues.

AntiMetaman

Will the ability to hide user ratings on every post except your own be implemented in the near future?

fzngagan

Yes, that’s on top on our list. I’ve created a feature request on our instance https://thepavilion.io/t/show-only-users-own-rating-on-posts/3209

Currently, we’re working on unit tests and we’ll implement this in the near future for sure.
p.s.
I have completed this one. If you can help to test, we can get it merged in this week. Follow the updates on the above link.

davidkingham

A little bug I’ve found: if you have Require moderator approval of all new replies turned on for the category, the rating is lost in the review process.

fzngagan

Yes, thats not handled currently. Can you create a report on our instance?

davidkingham

I was going to create a bug report on there but the ratings plugin is not in the dropdown in the bug report wizard

fzngagan

I’ve created one and mentioned you there.

p.s. Also added the ratings plugin to the dropdown

Varhall

Don’t show “Use topics in this category to rate things” in category setting. Discourse version 2.6.0.beta1. What could be the problem?

fzngagan

We did a major rewrite a month back. Your data is intact. Do have a look and update us on how the migration went.

Don

Hello,

Is that possible to hide ratings from create topic with css and only show on reply?

Thanks for the answer! :slightly_smiling_face:

Don

I think i got it, I leave here if someone want to use:
#reply-control.open.edit-title .composer-controls-rating .rating-container { display: none;}

Probably this is not the best way to do this but it works for me. If you guys have more elegant way to hide ratings on topic create and only show on reply please share me. Thanks :slight_smile:

fzngagan

If creation isn’t allowed, then how would the ratings appear at all?

Do you intend to point towards a concrete feature on who is allowed to give ratings?

p.s.
Oh you mean the OP cannot have a rating?

What’s the use case for that?

Don

The ratings allowed by category for me. I use it on a marketplace category so I don’t want the Seller rates their own product when create topic. I want to show this option only the buyer who reply the ad.

That is correct!

fzngagan

This would allow the seller to give rating on another post. Doesn’t have to be OP.

Don

I see now what is the problem :confused: so can I restrict the op cannot rate inside their own topic?

fzngagan

Its not available in the plugin currently. You can create a feature request here. Feature Request

If you have a budget, we can discuss and get it in sooner.

ipoopfool

I am also running into this problem. I just installed this plugin and I’m on discourse version 2.6.0.beta1.
There doesn’t appear to be any setting in the Category Edit modal to let me enable this plugin

fzngagan

The plugin has been almost rewritten. Now you go to /admin/plugins and you’ll see a ratings menu where you can adjust all the ratings settings.

ipoopfool

to clarify, ratings is installed and enabled in /admin/plugins. However, within a category’s settings, there’s no way to enable it for that category.

fzngagan

I see. There’s a breakage. I’ll fix it quickly.

p.s. I can confirm ratings works perfectly fine on latest tests-passed branch.

If you’re facing issues, please give me temporary access to your instance so I can take a look closely. You might as well consider a page refresh to see if the issue is still there.

AntiMetaman

I’ve rebuild to latest and if I don’t have this plugin uninstalled, I can’t view any topics. Even if I disable this plugin, it still gives me error. All plugins in my app.yml work except this one. It’s the only one I had to uninstall and then everything worked again like a charm.

And in my logs, it shows ratings is the issue:

Spoiler
plugins/discourse-ratings/lib/ratings/rating.rb:154:in `serialize'
plugins/discourse-ratings/plugin.rb:201:in `block (2 levels) in activate!'
(eval):84:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in `rescue in attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:455:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:347:in `as_json'
app/serializers/post_stream_serializer_mixin.rb:54:in `block in posts'
activerecord (6.0.3.2) lib/active_record/relation/delegation.rb:87:in `each'
activerecord (6.0.3.2) lib/active_record/relation/delegation.rb:87:in `each'
app/serializers/post_stream_serializer_mixin.rb:47:in `map'
app/serializers/post_stream_serializer_mixin.rb:47:in `posts'
app/serializers/post_stream_serializer_mixin.rb:18:in `post_stream'
(eval):3:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:468:in `rescue in attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:455:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:347:in `as_json'
activesupport (6.0.3.2) lib/active_support/json/encoding.rb:22:in `encode'
activesupport (6.0.3.2) lib/active_support/json/encoding.rb:22:in `encode'
activesupport (6.0.3.2) lib/active_support/core_ext/object/json.rb:42:in `to_json'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:331:in `to_json'
multi_json (1.15.0) lib/multi_json/adapters/oj.rb:56:in `dump'
multi_json (1.15.0) lib/multi_json/adapters/oj.rb:56:in `dump'
multi_json (1.15.0) lib/multi_json/adapter.rb:25:in `dump'
multi_json (1.15.0) lib/multi_json.rb:139:in `dump'
app/controllers/application_controller.rb:464:in `render_json_dump'
app/controllers/topics_controller.rb:1043:in `block (2 levels) in perform_show_response'
actionpack (6.0.3.2) lib/action_controller/metal/mime_responds.rb:214:in `respond_to'
app/controllers/topics_controller.rb:1033:in `perform_show_response'
app/controllers/topics_controller.rb:160:in `show'
actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:195:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:112:in `block in run_callbacks'
app/controllers/application_controller.rb:340:in `block in with_resolved_locale'
i18n (1.8.5) lib/i18n.rb:313:in `with_locale'
app/controllers/application_controller.rb:340:in `with_resolved_locale'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:121:in `block in run_callbacks'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:139:in `run_callbacks'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.3.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.3.2) lib/active_support/notifications.rb:180:in `instrument'
actionpack (6.0.3.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (6.0.3.2) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:136:in `process'
actionview (6.0.3.2) lib/action_view/rendering.rb:39:in `process'
rack-mini-profiler (2.0.4) lib/mini_profiler/profiling_methods.rb:104:in `block in profile_method'
actionpack (6.0.3.2) lib/action_controller/metal.rb:190:in `dispatch'
actionpack (6.0.3.2) lib/action_controller/metal.rb:254:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.3.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.3.2) lib/action_dispatch/routing/route_set.rb:834:in `call'
lib/middleware/omniauth_bypass_middleware.rb:68:in `call'
rack (2.2.3) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.3) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.3) lib/rack/head.rb:12:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:336:in `call'
rack (2.2.3) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.3) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/cookies.rb:648:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.3.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
logster (2.9.2) lib/logster/middleware/reporter.rb:43:in `call'
railties (6.0.3.2) lib/rails/rack/logger.rb:37:in `call_app'
railties (6.0.3.2) lib/rails/rack/logger.rb:28:in `call'
config/initializers/100-quiet_logger.rb:19:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
lib/middleware/enforce_hostname.rb:22:in `call'
rack (2.2.3) lib/rack/method_override.rb:24:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
rack (2.2.3) lib/rack/sendfile.rb:110:in `call'
actionpack (6.0.3.2) lib/action_dispatch/middleware/host_authorization.rb:76:in `call'
rack-mini-profiler (2.0.4) lib/mini_profiler/profiler.rb:321:in `call'
message_bus (3.3.1) lib/message_bus/rack/middleware.rb:61:in `call'
lib/middleware/request_tracker.rb:176:in `call'
railties (6.0.3.2) lib/rails/engine.rb:527:in `call'
railties (6.0.3.2) lib/rails/railtie.rb:190:in `public_send'
railties (6.0.3.2) lib/rails/railtie.rb:190:in `method_missing'
rack (2.2.3) lib/rack/urlmap.rb:74:in `block in call'
rack (2.2.3) lib/rack/urlmap.rb:58:in `each'
rack (2.2.3) lib/rack/urlmap.rb:58:in `call'
unicorn (5.6.0) lib/unicorn/http_server.rb:632:in `process_client'
unicorn (5.6.0) lib/unicorn/http_server.rb:728:in `worker_loop'
unicorn (5.6.0) lib/unicorn/http_server.rb:548:in `spawn_missing_workers'
unicorn (5.6.0) lib/unicorn/http_server.rb:144:in `start'
unicorn (5.6.0) bin/unicorn:128:in `<top (required)>'
vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `load'
vendor/bundle/ruby/2.6.0/bin/unicorn:23:in `<main>'
fzngagan

Hi, if you can give me temporary admin access, I can look closely. No repro on my side.

@Arkshine any clue?

note: I tested the plugin in isolation. Conflicts with other plugins is a possibility but can’t fix without concrete information.

AntiMetaman

These are the list of my plugins. Most are official and the rest are pavilion.

Spoiler
  - git clone https://github.com/discourse/docker_manager.git
  - git clone https://github.com/discourse/discourse-adplugin.git
  - git clone https://github.com/discourse/discourse-calendar.git
  - git clone https://github.com/discourse/discourse-chart.git
  - git clone https://github.com/discourse/discourse-math.git
  - git clone https://github.com/discourse/discourse-voting.git
  - git clone https://github.com/procourse/procourse-static-pages.git
  - git clone https://github.com/discourse/discourse-signatures.git
  - git clone https://github.com/Ebsy/discourse-nationalflags.git
  - git clone https://github.com/discourse/discourse-chat-integration.git
  - git clone https://github.com/discourse/discourse-solved.git
  - git clone https://github.com/discourse/discourse-graphviz.git
  #- git clone https://github.com/paviliondev/discourse-ratings.git
  - git clone https://github.com/discourse/discourse-tooltips.git
  - git clone https://github.com/cpradio/discourse-plugin-imgflip.git
  - git clone https://github.com/paviliondev/discourse-topic-previews.git
  - git clone https://github.com/discourse/discourse-bbcode
  - git clone https://github.com/discourse/discourse-affiliate.git
  - git clone https://github.com/paviliondev/discourse-news.git
  - git clone https://github.com/discourse/discourse-sitemap.git
  - git clone https://github.com/paviliondev/discourse-layouts.git
  - git clone https://github.com/discourse/discourse-assign.git
  - git clone https://github.com/gdpelican/retort.git
  - git clone https://github.com/discourse/discourse-canned-replies.git
  - git clone https://github.com/discourse/discourse-cakeday.git
  - git clone https://github.com/paviliondev/discourse-follow.git
  - git clone https://github.com/cpradio/discourse-plugin-composer-help-button.git
  - git clone https://github.com/paviliondev/discourse-custom-wizard.git
  - git clone https://github.com/discourse/discourse-perspective-api.git
  - git clone https://github.com/paviliondev/discourse-tickets.git
  - git clone https://github.com/discourse/discourse-spoiler-alert.git

Currently, I can’t afford to rebuild and have downtime on my site. I can check later.

fzngagan

That is quite a list to install and test on my dev setup to say the least so I can’t figure out what the cause of your issue might be.

AntiMetaman

Perhaps you can skip the official discourse plugins. Then the list would only be:

Spoiler
  - git clone https://github.com/procourse/procourse-static-pages.git
  - git clone https://github.com/Ebsy/discourse-nationalflags.git
  #- git clone https://github.com/paviliondev/discourse-ratings.git
  - git clone https://github.com/cpradio/discourse-plugin-imgflip.git
  - git clone https://github.com/paviliondev/discourse-topic-previews.git
  - git clone https://github.com/paviliondev/discourse-news.git
  - git clone https://github.com/paviliondev/discourse-layouts.git
  - git clone https://github.com/gdpelican/retort.git
  - git clone https://github.com/paviliondev/discourse-follow.git
  - git clone https://github.com/cpradio/discourse-plugin-composer-help-button.git
  - git clone https://github.com/paviliondev/discourse-custom-wizard.git
  - git clone https://github.com/paviliondev/discourse-tickets.git

I’ll DM you later to arrange for the admin access.

merefield

I would uninstall most of those. Keep only those which are critical to your users otherwise you are asking for trouble with a significant risk of a clash, breaking changes and a much more complex job of debugging.

Normally I’d expect to see around half a dozen on a reliable, business-focussed site.

I’m afraid we can’t support your install for you unless you wish to hire us.

AntiMetaman

I will do as you ask and uninstall the unofficial plugins and find the cause of the conflict. I’ll report back. However, I can’t do this currently since the site is being used by users, so I can’t afford downtime atm.

If we remove official discourse and pavillion, then only 5 plugins remain.

AntiMetaman

On latest rebuild, I have topic ratings plugin working with all my plugins and theme components! Initially, I had this plugin disabled because I wasn’t sure if it was ready. Apparently, having it disabled, I couldn’t read any topics. Enabling the plugin without doing anything else fixed the issue! I didn’t add or remove any plugins.

Don

Hello,

I have the same issue with this plugin. If i disable i get this message on all topics :point_down:
The logs error same as yours.

I have two different Discourse site so i check the plugins and compare with yours.

The same unofficial plugins are:

- git clone https://github.com/paviliondev/discourse-follow.git
- git clone https://github.com/paviliondev/discourse-custom-wizard.git

Edit: But one of my site the discourse custom wizard is commented so maybe the discourse follow plugin conflict with topic ratings.

Full plugins list / Site 1
  - git clone https://github.com/discourse/docker_manager.git
  - git clone https://github.com/discourse/discourse-solved.git
  - git clone https://github.com/jannolii/discourse-topic-trade-buttons.git
  - git clone https://github.com/paviliondev/discourse-ratings.git
  - git clone https://github.com/discourse/discourse-whos-online.git
  - git clone https://github.com/discourse/discourse-adplugin.git
  - git clone https://github.com/paviliondev/discourse-follow.git
  - git clone https://github.com/discourse/discourse-cakeday.git
  - git clone https://github.com/paviliondev/discourse-locations.git
  - git clone https://github.com/discourse/discourse-patreon.git
  - git clone https://github.com/paviliondev/discourse-custom-wizard.git
  - git clone https://github.com/discourse/discourse-spoiler-alert.git
  - git clone https://github.com/discourse/discourse-calendar.git
Full plugins list / Site 2
  - git clone https://github.com/discourse/docker_manager.git
  - git clone https://github.com/discourse/discourse-solved.git
  - git clone https://github.com/jannolii/discourse-topic-trade-buttons.git
  - git clone https://github.com/paviliondev/discourse-ratings.git
  - git clone https://github.com/discourse/discourse-whos-online.git
  - git clone https://github.com/discourse/discourse-adplugin.git
  - git clone https://github.com/paviliondev/discourse-follow.git
  - git clone https://github.com/paviliondev/discourse-multilingual.git
  - git clone https://github.com/discourse/discourse-calendar.git
  - git clone https://github.com/paviliondev/discourse-locations.git
  - git clone https://github.com/paviliondev/discourse-custom-wizard.git
  - git clone https://github.com/discourse/discourse-patreon.git
  - git clone https://github.com/discourse/discourse-cakeday.git

@fzngagan i can add an admin access one of my site if this helps to find out what is the problem.

AntiMetaman

Yea so to reproduce one can simply disable ratings plugin.

fzngagan

Taking a look in a few.

p.s.
Yes, I can repro the issue. Taking a look .

mohamad_azimi

Exactly I agree

we need this

Iceman

Can confirm the exact same issue described.

Repro Steps:

  1. Rebuild to Latest.
  2. Have the Topic Ratings Plugin installed.
  3. Have the Topic ratings Plugin disabled.
  4. Try to access any topic.

Workaround:

  1. Uninstall (comment on the yml) the Topic ratings Plugin.
  2. Rebuild.
fzngagan

@Don @AntiMetaman @Iceman
This commit fixes the issue

If you’re using it in production, I would suggest refraining from updating the plugin. Either keep it enabled or remove it if not required until the next support period begins.

AntiMetaman

Thanks for taking the time to fix this outside the support period.

davidkingham

Couple questions on this;

  1. When the first reply is deleted the rating doesn’t seem to be set back to no rating, see this topic. Is this expected behavior?
  2. The topic creator can reply to their own topic and leave a rating, shouldn’t this be ignored? See this topic.

Thanks guys!

fzngagan

Yes, that might seem like a side effect but the first post doesn’t define the ratings being enabled on the topic or not.

Yeah, they can rate for each criterion only once so basically can’t influence the ratings completely. But the request makes sense for some use cases.

fzngagan

Also, the support period is on. The plugin is working perfectly fine on the latest tests-passed as of now.

Bcat

Can it be considered an error?
Or I’ll have to delete this for it to work.

https://search.google.com/structured-data/testing-tool/u/0/#url=https%3A%2F%2Ftry.thepavilion.io%2Ft%2Fthis-is-a-new-post-with-ratings%2F547

fzngagan

I’ll happily accept a PR if you can try and fix.

Bcat

It’s the same way though it’s not true.

Demo: https://search.google.com/test/rich-results

It’s not exactly how the extension works, but it’s still useful for getting featured at google. My website doesn’t matter as much to reviews because of its few members.

Gustavo_Papasergio1

Hi all! How can i make that ratings shows on every single thread for logued and not logued users?

Thanks

fzngagan

You can enable ratings for all categories.

Gustavo_Papasergio1

I tried, but couldn’t find where to do it

Siddhu_Dhangar

I installed this plugin on new discourse instance and version of this instance is 2.6.0.beta2. Earlier it was working fine.but now It is not working. Can you help me out ?

fzngagan

Which branch, version are you on? Also, the support period has passed so we won’t guarantee a fix.

Siddhu_Dhangar

i cloned the github repo which is GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things. I checked. i am on master branch.

fzngagan

Ok, I’m bookmarking this. I’ll take a look when I have some time.

Faizan_Zahid

@angus @fzngagan i have a food recipe forum. and i want my users to vote on topics and recipes posted by others users in form of posts. and i want to show these star ratings via schema.org so google can recognise this structure data and show the starts on my google search results page. How can i do this, does this plugin support google structure data already ?

Also, is this plugin compatible with discourse solved and discourse question and answer plugins, so that other users can also vote up or down other people posts/topics along with stars?

fzngagan

@Gustavo_Papasergio1
We have a new admin panel for the ratings stuff now. If you go to yoursiteurl/admin/plugins, you’ll see a Ratings tab where you can tweak all the settings. For enabling on the whole site , you’ll have to enable the said rating criterion for all the categories. Do get back if you get any difficulty in doing that.

fzngagan

I’ve left a review on your PR. Can you make the suggested change? Thanks for pointing out the issue.

fzngagan

There’s one PR to be merged soon related to schema.org data which will make it work reliably.

For compatibility, do try and let us know. Its a dynamic ecosystem so you’ll know better when you try :wink: .

Faizan_Zahid

So do i wait for the new update and then install this? or if i have installed this plugin already, can i get its plugin updates directly from admin GUI?

fzngagan

You can install and get the update later via gui. Just that our free support period is first 5 days of every month and you’ll have to wait a few days if something is broken.

Faizan_Zahid

Okay good. so best case is to try plugins in first 5 days of any month and inform u guys of any bugs or compatibility issues if any.?

If i install pavilion plugins after 5th of the month days, then i have wait more?

Also, i have installed the rating plugin, and enabled it, but i dont see the settings anywhere to enable topic ratings on a category or on a specific tag. I have checked tag settings, category settings, and ratings plugin settings, but didnt find to do this anywhere. can u help?

fzngagan

@Gustavo_Papasergio1 @Faizan_Zahid

Rating Types - Ratings - Pavilion

This topic will be helpful. More to come in that space.

Bcat

You can use cache at here: GitHub - bcat95/discourse-ratings Only a few lines changed.

fzngagan

Ok, I’ll do some research myself and figure out what the correct schema.org metadata should be.

Siddhu_Dhangar

I installed topic ratings plugin from GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things master in discourse instance. I enabled ratings plugin from plugins setting but i am not able to give rating to any topic.

i attached some screenshots below for your reference.

I Installed same plugin in older version of discourse instance. there it is working fine.

Can you help me out to solve the problem ?

fzngagan

I’ll try to check today but no promises. Our support period is first 5 days of the month :slight_smile:

Also check /admin/plugins/ratings for setting up the ratings.

Faizan_Zahid

@fzngagan I followed your steps, but i do not see any way to create a rating type in admin panel, please see below:

all i see is this

Where do i configure adding new rating types and set them on categoires or tags ? i also went to categories settings but i dont see any option to enable to add new ratings type on tags or categories.

fzngagan

Please go to /admin/plugins

Faizan_Zahid

i have gone to /admin/plugins

i see settings for ratings plugin

but when i click settings, i just see same settings screen which i sent u in my last reply. i dont see anyway to create ratings or rating types :o

Don

Hello,
On this page left side you see Ratings click it. But first enable it.

renato

Nobody else needed to bypass the min post length setting for ratings-enabled topics?

The idea is to allow the reply to omit a post body if a rating is set. I’ll eventually take a shot creating a plugin just for it, but if anyone else solved a similar problem and can share how, that’d be great.

Faizan_Zahid

ok thanks now i have configured it, @fzngagan i am having an error Invalid object type for field "itemReviewed" on Google rich snippet test, when i try to add a topic rating on a topic which is basically a Recipe type, what am i doing wrong?

The URL where i am having this issue is on How to make Buttermilk - How To Discuss

I want 2 things:

  1. For the topic author to rate a topic/recipe about how easy this recipe is and how fast or long is it.
  2. I also want forum users who are reading a Recipe to vote for the Recipe easyness and tastyness etc.
  3. I want Google rich snippet to be validated soo my topics can be shown as stars in SERPs search engines.

Please help me what am i doing wrong?

Bcat

Can see temporarily here : Update aggregate_rating.html.erb · bcat95/discourse-ratings@b5093da · GitHub

fzngagan

@Faizan_Zahid
I’ll take a look in the weekend.

Faizan_Zahid

thanks @fzngagan, you can see commit of @Bcat he has fixed this bug but these changes r not live on plugin yet. Once you get it done by weekend, please let me know I can test again.

fzngagan

He’s not confident that the changes are general enough for the plugin.

I need to research about the correct metadata tags required.

Faizan_Zahid

that would be awesome, many thanks for your help in adding schema.org

fzngagan

Guys the support is already on. I just tested on the latest discourse and the plugin works fine.

Faizan_Zahid

I’m getting the rating snippet reviewerror in my Google search console. did u fix this? I will check

fzngagan

I’ve created a feature request Correct schema.org meta for multiple ratings - Feature Requests - Pavilion
and assigned myself to it. :slight_smile:

Faizan_Zahid

Sounds good faizan. @Bcat also did a fork and fixed it and he is confident it’s working fine but u know best, so u can also do it your way it will be best to validated in Google structure data. thanks for helping.

fzngagan

I’ve just pushed a few fixes which should make the metadata google happy and the data more accurate. Do check and get back.

@Bcat I think my version is more accurate because aggregateRating should have its parent as CreativeWork and not CreativeWorkSeries as per the official doc. Also, its better to rely on the actual repo instead of a fork.

fzngagan

Is google happy with the changes? Feedback welcome :slight_smile: @Faizan_Zahid

Faizan_Zahid

@fzngagan i have just updated the plugin and tested on this topic, i still see the same error. My rating topic is How to make Buttermilk - How To Discuss

and when i put it on google search console https://search.google.com/test/rich-results?id=O7esO32MqbkeGCJKrZBYKA i see the same error,

I also see lots of warnings too on same above link of google.

Am i setting up the rating types wrongly or what am i doing wrong? My goal is for my users to see the rating snippets on google search results when they see my website. Like i see for other recipe sites,

But receipes are just examples, my topics could be on any niche and ratings can be given on any niche, the stars should show relevant to the page content on google search results.

Gustavo_Papasergio1

Hi, thanks @Faizan_Zahida and all the rest for your support.
I finally found how to rank the posts. however, fundamentally I am needing any user, registered or not, to be able to assess the contents. Is this possible?

Thank you very much.

Faizan_Zahid

@Gustavo_Papasergio1 yes its possible for me, u can send me URLs to test, i will check them in google search rich snippet test tool.

Can you explain me how did u fix the star rating error in schema .org ? and how google is ranking u? show me URLs example please.

Gustavo_Papasergio1

Hi @Faizan_Zahid

I think there is a misunderstanding due to my poor level of English. I meant that I was able to get work rankings in all categories of my communiy, Althought definitely couldn’t create the rich snippet for ratings shows in Google SERP. However I think a possible solution to your problem can be solved here

Unfortunately I am not a great coder, so I am still a bit lost on how to start modifying the plugin.

I hope I have not caused you false expectations.
Greetings and apologies.

Faizan_Zahid

thanks @Gustavo_Papasergio1 this guide will be best helpful for @fzngagan, ad you can see this URL has rich snippet working perfect for rating in google https://search.google.com/test/rich-results?id=EneVj_v47tXnaaMzPVNnzw

but my topics are breaking due to a little bug in Discourse rating plugin. i hope @fzngagan can look into this i eeven updated the rating plugin but i still see same error on my rich snippet test :slight_smile:

URL which has incorrect rating error by google is Essential organic oil - HowToDiscuss

Gustavo_Papasergio1

Thanks you @Faizan_Zahid, other suggestion to @fzngagan is a option to add a check box that allows users not connected to the community to rate the content.

This is especially useful for understanding the quality of the content. Since only between 5 and 10% of users who browse a community connect with a username and password. Therefore, almost 90% of users do not have the possibility to assess the quality of the content.

Thanks to all and sorry for my basic english.

fzngagan

I’m aware of the fail. The problem here is, when you have multiple rating types I’m trying to figure out the structure of the schema markup.

I’m experimenting with this tool

Gustavo_Papasergio1

@fzngaganI can imagine the complexity of the rich text results because also google changes the specifications quite often. As for the non-connected users to be able to evaluate the contents, perhaps choosing only one to be public and the rest only for the logged-in ones. Not necessarily all have to be public.
Thank you very much for the reply.

davidkingham

I searched through this topic but didn’t find any mention of this; is there any possibility of making the rating required when replying to a topic?

fzngagan

Not currently. You can request the feature on the Pavilion instance.

Arkshine

API event bug:

If you create a new post with ratings or edit a post with different ratings, the post_edited or post_created events doesn’t use the new values but the old ones.

E.g.:
On new post with valid ratings, the event will have an empty ratings value.
On post edition, if you change from rating 5 to rating 2, the event will contain a ratings value with 5

It happens either using Discourse directly or using the API.

Here a small video on edition:

fzngagan

Ok, taking a look whether I can repro it.

p.s.
It looks like this is the older version of the plugin as I can’t see any rating criterion next to the stars.

Arkshine

When I posted my previous message, it was up to date, you can see it in my previous screenshot. e3ee07f

I’ve checked again throuhg the UI, and +2 commits have added since then, some hours ago.

But this doesn’t seem to include any relevant code changes to the issue (only spec related).


As far I can see, it’s up to date. I can try later to rebuild the app if for some reasons the plugin did not get properly updated (?).

If you need more info, feel free to ask.

fzngagan

Can you send a screenshot of this page of your site /admin/plugins/ratings?

Arkshine

I thought I mixed the production Discourse and my testing (= not local, on another vps) DIscourse, but both have the same version.

My test above has been made on my testing Discourse, so settings are like:


Actually, I did not test if it happens on the production Discourse (will check in a moment, EDIT: it happens too, event doesn’t contain updated ratings)

Settings for production Discourse:

EDIT: rebuilding didn not help.

GCB

Wondered where I could check the example.
Should I see ratings here? I’m logged in on the forum.

hosna

Is this plugin no longer working? @fzngagan @angus

fzngagan

I’ll take a look in some time.

fzngagan

Looks good to me. Can you tell us the specific issue?

Don

Hello @fzngagan :slightly_smiling_face: There is an error with Topic Rating and the new reply filtering system. If try to use posts in topic function on user card it won’t show results. Thank you :slightly_smiling_face:

hosna

the rating isnt shown even in example you provided in here:

and I cant find the option to enable rating for a category.

Arkshine

Any news about the issue posted one month ago: Topic Ratings Plugin - #353 by Arkshine ?
I’ve upgraded everything and it still happening.

fzngagan

Looks like a conflict coz I cant repro the issue since you reported it.

Arkshine

I’ve rebuilt with only this plugin and no components enabled.




post creation with ratings → ratings empty.
post edition without ratings → ratings shows the previous value

I don’t think I’m hallucinating. I did test on a client (production) Discourse as well, and it happens too.

What am I supposed to do now, any ideas?

Arkshine

@fzngagan

Launched a small VPS with a fresh and classic Discourse installation.
Everything is default except the adding of ratings plugin. I can’t do more basic than that.

https://rating.arkshine.dev/


I’m puzzled how you can not reproduce this! Did I miss something or did horribly wrong?

You can check/test yourself: Admin / b4HuH8u6CyKbDdJ
VPS will be destroyed in few days.

fzngagan

I’m taking a look at this one now.

fzngagan

Thanks for setting up the VPS. I was able to change update the ratings on your VPS too. I suspect you’re trying to do the thing via an API? I can assist you with that on a PM.

Just be clear, can you confirm everything works fine with the discourse UI and only an issue while using the API?

Although, I see a small issue with the category settings but that’s not completely related I guess?

p.s.

I think I know what you are pointing at. Are you pointing at the fact that when you open the composer with Uncategorized selected, it doesn’t show any rating options in the UI. Yes, that’s a bug but I couldn’t gather that from your explaination :sweat_smile:

Arkshine

As reported Topic Ratings Plugin - #353 by Arkshine ; the event bug happens with either composer or using the API.

Not sure what issue you’re referring, but it should not be related to the event generated.

This is NOT my issue, this is NOT what I’ve reported. I’m really confused, don’t you see the event bug, despite the screenshot, videos & explanations?

Will try again: whatever you post with composer or with the API, the generated event, here post_created or post_edited should include the actual ratings values after saving. Currently it includes the previous value.

E.g.:
I post a message with rating of 5:

  • current behavior: post_created event includes ratings: []
  • expected behavior: post_created event should include the value of 5: ratings: [value: 5, ...]

I edit the same message with rating of 1:

  • current behavior: post_edited event includes ratings: [value: 5, ...]
  • expected behavior: post_edited event should include the new value of 1: ratings: [value: 1, ...]
fzngagan

Are you referring to the webhook event?

Arkshine

Yes, this is what I talked about since the start, I believe?

fzngagan

You used the word event but it would have sufficed for you to have said webhook event. Our current code doesnt pass the rating details correctly to the webhook payload.

I do acknowledge the confusion on my part too.

I think its an intresting usecase though. Can you create a feature request on our Pavilion instance?

Arkshine

Come one, I know my english is not the best, but I showed you many times with screenshot and video, the webhook events panel, describing exactly the ratings field value issue, with the name of the events post_created/post_edited (with code formatting) which can be only webhook event names…

Alright, will create a bug report there.

fzngagan

I said feature request coz we don’t gurantee(yet) that the webhook payload will reflect the custom fields we create for our plugins. But we’re flexible on what the reports should be called. :wink:

fzngagan

Can you create a bug report on https://thepavilion.io?

hosna

I dont underestand these new options. where are they explained?

fzngagan

Hi @hosna
I do realize we’re a bit behind in terms of documention how the new ratings system works for the admin. Although, there’s this topic which can help you get through initially. Rating Types - Ratings - Pavilion

Secondly, if you can point out the pain points in setting up the plugin, I can help you out via a PM and can write more docs which would be helpful for others too.

Iceman

Hi,

Was playing around with the plugin to see how it works and as of now ( Discourse 5cff198aba with latest Ratings Plugin), there is a small bug that I thought I would let you guys know about:

If you try to filter the replies on a topic per user, the result is blank, does not show any results. It does “finish” loading/filtering, but it’s just blank, empty.

This happens with both the new reply filter option and the default one. However, the new message/reply filter option does work perfectly and it is my understanding that this new filter leverages on the user-reply-filter that doesn’t seem to work when the Topic Ratings Plugin is enabled.

If you disable the Plugin, it works as usual.

Thanks for the great work you guys do!

fzngagan

Thanks for the catch. can you report it at Bug Report

kinqlev

Thanks for the plugin!

Can have a small feature that restrict rating base on the account age / days visited / posts read / topics posted etc to prevent user creating new accounts and manipulate the ratings?

fzngagan

Please make a feature request here. Feature Request

GVG

Hi, when topic have for example 5-10 rating parameters it can be too much to display them at topics listing, search results, etc. Can your plugin:

  1. Auto-calculate the average number of all ratings at 1 message and display avg number at each message with ratings?
  2. Auto-calculate average number for all avg rating of rating messages inside topic and display it at topics listing?

If not - how fast you can add such enough simple feature, please?

balupton

Can this link be updated with a topic that exhibits the rating functionality, thank you!

oganer

Updated link in first post.

Randy_Hulett

Our community members often submit solutions as new topics. We’d love to implement a plugin like this so community members could validate the functionality, usability and security of submitted solutions. We are intrigued by this plugin.

We are on a Discourse-hosted business plan, and it appears that this plugin can only be installed on communities not hosted by Discourse.

As there doesn’t appear to be anything similar in the plugin directory, does anyone have any recommendations on how to implement custom ratings on a per-topic level within specific categories?

Thanks,
Randy

angus

Not that I’m aware of. It’s probably worth discussing this with Discourse.org support though.

darkpixlz

Hey, the plugin is breaking the reply composer. Not the background, that’s just firefox being firefox, but I cant see the preview and upload images. Please fix this ASAP.

merefield

Our free support period is outlined in the OP. Generally we aim for compatibility then.

Thanks for the report.

merefield

I’ll be honest, that video is a bit confusing.

I’ve found one issue, a call to a deprecated resize method that needs updating to its replacement.

Are you sure the other errors are due to ratings plugin?

merefield

OK I’ve merged a PR to fix that method, and had a little scoot around the app, seemed ok? Although I do see a couple of deprecation warnings that may need addressing soon … I’ll try to clean those up soon.

Let me know if any other breaking issues. I can’t guarantee I will get to them before the support period.

darkpixlz

Seems like another error popped up, so I will disable the plugin until the support period arrives and it gets fixed.

Thanks :slight_smile:

merefield

What error? Please include console and /logs output

Don

Hello Robert,

This is the topic about this issue.

I checked it and there is no error on console or /logs

Thanks :slightly_smiling_face:

merefield

Hey guys,

We’ve just merged a PR to resolve several issues and make Ratings compatible with drafting.

  • NEW FEATURE: stores and retrieves ratings to and from drafts
  • FIX: resolves an issue where type names were not repainted on Topic header when post rating updated
  • FIX: resolves an issue where composition of a new Topic generates an exception because post attribute can be initially null.
  • FIX: resolves an infinite loop when confirming if to reply to original topic or currently presented one
  • COMPATIBILTY: Resolves various core compatibility issues and deprecations to clear out the browser warnings on the Topic page.

As this was a fair amount of changes and this plugin sadly lacks unit tests at this stage, I’d be most grateful for feedback.

Sorry this took a while, moving Ember Computed Properties to getter/setters introduced new issues that needed to be tracked down.

@darkpixlz @Don

Chandra

Nice plugin.

Potential Bug 1:
Saving a new tag-types row displays an infinite busy circle, though it saves the details. One has to click on something else and come back to the Ratings screen.

Potential Bug 2:
With Air theme, the excerpt for rating topics in mobile view is displayed above the topic title, while the normal for any other topic is below the title.

Feature Request 1:
Option to restrict rating only to the author, i.e., the first post, to post site’s official reviews

Feature Request 2:
Ratings to be marked up, for google to pick up and display the ratings in search

jumagura

Hello @Chandra,

Thanks for the feedback. I was able to reproduce the first bug.
I will take a look next week.

Chandra

Thank you @jumagura, I hope you will be able to spare a look at your convenience.

I also wanted to draw your attention to this one below, based on a google search console notice I received. Aligning ratings to google markup will be a game changer for google rankings, so please consider it.

Google Notice:

Search Console has identified that your site is affected by 1 Review snippets structured data issue(s). The following issues were found on your site. We recommend that you fix these issues when possible to enable the best experience and coverage in Google Search.

Top critical issues*

Rating is missing required best and/or worst values

*Critical issues prevent your page or feature from appearing in search results.

Chandra

Additional information on google search console errors are here. Thank you.

Michael_Smith2

Too Many Errors on Google Webmaster tools


Here is My Forum - https://forexkite.com

jumagura

Hi @Chandra and @Michael_Smith2

This PR should solve take care of Google Webmaster tools errors. It’s already merged

Thanks for the feedback and the patience.
Let me know if any other breaking issues arise.

Chandra

Super thanks for your attention and effort. Will check it out.

Fred_Koehler

This is a great plugin! I’m trying it out for a novel solution to a rank elements of storytelling in someone’s scene or chapter that they’re writing. Issue that pops up is that the names seem to pile up in the reply window and make it impossible to type any text. Is there any way to have them go side by side instead of a carriage return between?

jumagura

HI @Fred_Koehler,

Thanks for the feedback. I will reproduce the problem and find a solution for that.
I will take a look next week.

Olga_Averchenko

Where can I see this plugin in action?

jericson

I had the worst time figuring out how to enable ratings on a post. From the README:

Topics can be designated as ‘for rating’, by being posted in a category with ratings setting on (see below), or by being given the tag ‘rating’.

I couldn’t determine what “see below” referred to and I wonder if something is missing. I tried creating a rating tag, but that’s not working at this point. Meanwhile I followed the advice from this post:

Good to know those options exist, but it didn’t help me enable ratings:

It took me an embarrassingly long time to find the settings for enabling ratings on a tag or category: /admin/plugins/ratings.

I’ve created a PR, but it probably needs to be fleshed out a bit more.

RGJ

Thank you for that feedback - but the plugin does adhere to the de facto standards where

  • all site settings for a plugin can be accessed by going to Admin - Plugins, looking up the plugin and clicking its Settings button?

  • all advanced settings are accessible by going to Admin - Plugins and then looking for the plugin name in the second menu bar

jericson

I didn’t know that this was some sort of standard and I use that menu bar almost every day. (It’s the Data Explorer menu bar in my mind.)

Looking again, I see that the RSS Polling Plugin is there and I configured that at some point. My guess is that I was helped by the excellent documentation.

Given this is a sort of a standard, would it not be helpful to have a link to the advanced settings next to the site settings link? It wasn’t at all hard to find the other settings and it left me thinking I’d found all that existed rather than just half the settings (and none that I needed to get started).

frold

Is it possible to use 2 step rating instead of stars?`

Like :+1: :-1: With a result like

:+1: (69%) :-1: (31%)

n1bff

Does this plugin expose the average rating and number of ratings of a topic as 1-2 simply API calls somehow?

n1bff

And is it possible to show the ratings when embedding Discourse as in Embed Discourse comments on another website via Javascript ?

n1bff

As a user, how can one see all one’s ratings?

PS: Sorry for posting question after question, but I think this is the appropriate please, yes?

jumagura

HI @frold,

I appreciate your patience and apologize for the delay in my response. I’ve been preoccupied with other commitments but am back now and ready to address your questions.

The possibility of having a 2-step rating system is interesting. The current design of the Topics Ratings Plugin supports a star-based system, but I see the value in a simpler, thumbs up/down system. Although this is not currently a feature, it’s a compelling idea and I’ll certainly explore its feasibility for a future update. We are also open to sponsorships or funding for the development of specific features. If you’re interested in sponsoring this feature or any other, please feel free to get in touch.

jumagura

Hi @n1bff,

My sincere apologies for the delayed response. Your patience is truly appreciated. I had other engagements that required my attention, but I’m now here to focus on your inquiries.

As of now, the plugin does not provide direct API calls for average rating and number of ratings for a topic. While we recognize the convenience this could provide, it’s not a current feature but something I’ll certainly consider for future enhancements.

Similarly, displaying ratings when embedding comments and providing a consolidated view of all a user’s ratings are not currently supported. These are thoughtful suggestions, and rest assured, I will look into their feasibility.

As we are an open-source project, any feature developments could be expedited through sponsorships or funding. If you or your organization are interested in sponsoring these or other features, please reach out.

LoveMCJ

I cannot delete the Type because of an error.

When I try to delete “The Name is … and the Type is empty”, an error message “The requested URL or resource could not be found.” is displayed and I cannot delete it.

Even if I uninstall and reinstall the plugin by “Rebuild the container”, the same error occurs.

Arkshine

It appears that an invalid type was added, resulting in an empty type. The plugin definitely needs a sanity check for input validation.

For now, you can use the Rails console to delete the empty type:

cd /var/discourse
./launcher enter app
rails c
DiscourseRatings::RatingType.destroy("")
exit

Refresh the page, and it should be gone!
Keep the type simple, such as my_type, and you are good. :smile:

LoveMCJ

That’s super cool! Thanks for telling me.

LoveMCJ

Text categories other than English are not displayed.

Categories must be displayed for non-English text to be managed.

How do I display them?

※ Also, In the case of Type, an error will occur if a non-English character is entered.

Arkshine

@LoveMCJ A quick fix for this is to define a slug for your category, then delete/add the category for the rating again. This should work!

@jumagura

I see an issue here:
https://github.com/paviliondev/discourse-ratings/blob/main/assets/javascripts/discourse/components/rating-object.js.es6#L52

Category.slugFor will return either the slug if it exists or {id}-category if not defined.

The plugin uses findBySlugPath, which only looks for categories with a slug defined.
For categories without, findSingleBySlug should likely be used as well.

https://github.com/paviliondev/discourse-ratings/blob/main/assets/javascripts/discourse/components/rating-object.js.es6#L29

I hope that helps! :slight_smile:

LoveMCJ

:heart_eyes:I really appreciate it from the bottom of my heart.

restivulmu

Hi,
The rating star appears on any topic title page.
But on the homepage, I see [object Object] instead of the rating star of the posts.

How can I fix this?

*Note: The problem occurred after the update.( Discourse and Topic Ratings Plugin and other Everything is up to date)

restivulmu

When I remove this option, the [object Object] text disappears. Are you planning to do anything about this? I think this should be fixed.

Kind regards. Good Work. @jumagura

image

Arkshine

@merefield

On your last changes

It misses:

import { registerRawHelper } from "discourse-common/lib/helpers";

registerRawHelper("rating-list", _ratingList);
merefield

Ooooops! You are quite right! thx!

merefield

done:

bdfl

Hi, can this plugin be used for rating posts rather than topics? If so, could someone let me know if it also do these 3 things?

  • enable rating on all posts in a topic after the posts are created
  • be configured so that users can’t see other users’ ratings or average ratings
  • export a CSV with each user name and their ratings for each post
Arkshine

Hi, :wave:

That’s not possible with this plugin.

The closest plugin I could find is Discourse Post Voting (thanks, Jammy, for correcting my silliness :sweat_smile:). Users can upvote posts once per topic (except the first post), so the rating would be the number of upvotes.

To export a list of users with ratings, you can use this plugin: Discourse Data Explorer. You can create an SQL query, and you will be able to download the list in CSV format. Check data & reporting sql-query if you need help.

Also, there is marketplace if you can afford to sponsor someone to make the exact plugin you’re looking for. :+1:

JammyDodger

Just an FYI, that plugin has been deprecated in favour of the official Discourse Post Voting plugin.

Arkshine

Damn, I can’t believe I missed the plugin. I knew it, but I could not find it. Thanks for correcting me; I appreciate it! I have always had a hard time with the search ahah. :smile: (EDIT: and I just noticed I completely missed the first message in the deprecated plugin :rofl:)

bdfl

Thanks for the replies. That’s good to know about the data explorer and the marketplace. The official plugin won’t work for me, unfortunately. I’m curious which requirements this plugin cannot do - is it just the rating on posts (vs topics)?

Arkshine

It’s simply not designed to work this way. It’s always possible to modify it, and that’s what marketplace place is for. :+1:

papergossip

Hello, May I ask if this problem has been solved? I had the same problem. It seems that this problem could be solved by manually adjusting the height of the reply menu, but it would affect every user’s first-time experience. It also reduces the area of the topic you see. I think the best way to solve this problem is to arrange the text horizontally instead of vertically

Roi

I just found a deprecation notice in the developer console of my browser:

deprecation-identify-source.js:15 DEPRECATION: [PLUGIN discourse-ratings] The topic property path was used in the discourse/plugins/discourse-ratings/discourse/templates/connectors/topic-category/topic-tip-container.hbs template without using this. This fallback behavior has been deprecated, all properties must be looked up on this when used in the template: {{this.topic}} [deprecation id: ember-this-fallback.this-property-fallback] This will be removed in ember-this-fallback n/a. See Resolving the `this-property-fallback` deprecation for more details.

Just wanted to bring this to attention - although I cannot fix it myself. :see_no_evil_monkey:

cmdntd

Could you check this plugin?

It has error with the latest version of discourse.

Detected themes/plugins which are incompatible with the new 'glimmer' post stream. Falling back to the old implementation.
The following plugins and/or themes are using deprecated APIs
Chandra

Plugin is broken with the post stream changes.
A kind request to @jumagura to please help update this super useful plugin.

[Admin Notice] Plugin ‘discourse-ratings’ contains code which needs updating. (id:discourse.post-stream-widget-overrides)

jrgong

Seems like it’s not being maintained anymore… we are also encountering deprecation errors on 2025.12.0

jumagura

Thanks to @RGJ. This plugin is now updated :rocket:

n1bff

The plugin’s functionality has completely vanished from my forum now. In the admin interface I see:

The forum posts in the category where users were previously able to rate topics show no ratings widgets anymore.

If I recall correctly, I had to choose a category to enable the ratings in the settings or use a special tag for the category. But I could find zero documentation for that in GitHub - paviliondev/discourse-ratings: A Discourse plugin that lets you use topics to rate things · GitHub and this thread is too huge to read through all posts for any hints.

Any idea what is wrong with my forum? It is up to date.

Arkshine

There are leftovers (widget) which should be removed, from Compatibility update for v2026.01 by communiteq · Pull Request #76 · paviliondev/discourse-ratings · GitHub

I made a PR to fix the issue:

n1bff

I think those widgets are exactly what I am missing. Previously one could use stars to rate the topic. But maybe it works differently now?

Arkshine

Correct, it has been replaced in the previous PR I linked above with components.
But the PR did not remove the widget files and you get an error because it references paths that doesn’t exist anymore in core.

RGJ

Thank you for pointing that out @Arkshine and my apologies for making a mess of this.

To make it even a bigger mess, I completely modernized the plugin last week (gjs + Glimmer + cleanup), but I did not make a pull request yet because I was still testing it.
It’s here GitHub - communiteq/discourse-ratings: A Discourse plugin that lets you use topics to rate things · GitHub

n1bff

Oh sorry, then I am probably just too clueless about Discourse. I have no idea what widgets or components are since I am just a user, not a programmer. :smiley:

Do the existing widget files lead to errors that stop the components from working? Then I am super happy and thankful about your PR!

Arkshine

No worry! You understand correctly. The PR removes any references of widget and making the plugin work again. :smiley: Note the PR has been merged, if not done already, you can update the plugin.

n1bff

Works like a charm, thank you so much!

RGJ

@jumagura @angus @merefield i have Glimmerized and overhauled the plugin and made a PR. Could one of you please have the second pair of eyes on it and merge it?

merefield

I’ve contributed to and merged the PR, thanks @RGJ :partying_face:

Eviepayne

It’s great this is working but I don’t understand what the types are.

Eviepayne

Bug report: [Bug] Ratings tags don't stick · Issue #79 · paviliondev/discourse-ratings · GitHub
tag ratings don’t stick