Topic Ratings Plugin

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

: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:

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

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

2 Likes

Thank you! Its working fine now :sparkles:

1 Like

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:

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

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

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

2 Likes

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.
1 Like

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.

1 Like

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

It should work as normal again.

https://github.com/angusmcleod/discourse-ratings/commit/507f8e6e95fd88dc07d1f2a234b4a4c5f91545e7

2 Likes

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

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.

https://github.com/angusmcleod/discourse-ratings/commit/8f176955daa1f54d64745ad5e4e8de60838328d0

3 Likes

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ā€¦

You canā€™t rate your own posts. Could that be it?

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?

1 Like

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.

1 Like

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

Iā€™ve definitely upgraded several times since that commit.

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.

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

https://github.com/discourse/discourse/commit/5794ff53a197b35e67a8ecfbedc6d7d626e872be

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.

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 https://github.com/angusmcleod/discourse-ratings/blob/master/plugin.rb, 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)

1 Like