Issue with ratings not working

@Arkshine reported this one. Here’s a PR fixing it. FIX: use .slug instead of slug_path as we are using slug while migrat… by fzngagan · Pull Request #21 · paviliondev/discourse-ratings · GitHub

Thoughts @angus ?

I’ve tried to make the changes directly to the plugin ( enter app ).
While I can see the old ratings, adding/updating/deleting post ratings still doesn’t works. The endpoint /ratings is not even called when you save the message.

Actually, adding and updating rating works, but you need to refresh the page (It’s weird because I don’t see any /ratings call…)
Deleting is ignored. The checkbox has not effect:
2020-07-05_12-29-03

This is what you have when you first add a new rating, after hitting the save button:

Also, the first time you want to review, you see:
image
It should not be ticked by default.

1 Like

Ok, thanks for the update. By deleting do you mean unchecking the rating after you’ve rated?

Yes, the checkbox has no effect on the visual stars. Even so, when you unchecked, save the message, and refresh ; the rating is still there.

1 Like

Ok, thanks for helping out in uncovering this issue. I’m starting a new topic for this. Also, I’ll close this one once my PR is merged.

1 Like

Hey thanks for the feedback and the interest in the plugin.

Just a note that the best way to modify other plugins is by creating a new plugin that is loaded after the plugin you’re trying to modify. You typically do this by sticking an x- in front of the name, e.g. x-discourse-ratings. Plugins are loaded alphabetically.

Ratings are passed as custom_fields in the existing Discourse CRUD calls. There is no seperate call to a ratings endpoint.

@fzngagan The main issue here is that discourse now includes category ids in slugs. This changed since we released the feature. See use of full_slug, which now includes id.

1 Like

Oh looks like you already figured it out :slight_smile:

Does this work for both parent and children? I think the reason we were using full slug there is because (I think) you can have the same name for a child, e.g. /cat1/cat2 and /cat2. Please double check that.

Morever, that won’t work for existing records that used the full slug. I think you need to “normalize” the slug somehow here.

1 Like

I’ll check that.

The problem with this is, I think we’re not actually using full slugs while storing the settings. Maybe that should be changed I think.

1 Like

Any news on this issue?

1 Like

Setting some time aside on saturday to look at this. Need to have a concrete strategy as the plugin is being used in production by a big firm.

Hey, just to let you know that this issue is fixed now.

Editing the ratings works now! Deleting is still ignored (including checkbox being unresponsive and not hiding stars) and does nothing after post is saved.

There is also something wrong with the checkbox status. Initially, it should not be ticked I believe.
image

1 Like

Hey, I’m sorry to ask that, but any news/status? :pensive:

I mean, I’m working on the behalf of a client. It has been almost now 1 month those new public changes have been published and it’s still not fully working.

Currently I can’t update Discourse because of this plugin and if I would have followed your policy to update in start of July, I would have been in big trouble because nothing was fixed by the 7th day.

I understand it’s open-source… I understand you may have various reasons. I’m not blaming you. I’m just concerned that critical bugs are not going to be fixed as said in the policy. and it’s not encouraging in the long-term.

Is there anything we can do to help with this? Do we need to pay a service to have this plugin bugs fixed and if so, can you share details?

Why can’t you update now?

You published a new public version 1 month ago, and plugin is (still) broken.
That those changes lack some testing, support doesn’t follow the policy and takes time, means is quite risky to try an update now.
I can’t afford to manually update Discourse & every plugins one by one.No matter the solution, it will increase the downtime.

If you can’t support the plugin, may I suggest to try to ask on meta for help and/or money if it can help the plugin to not be left in a broken state (we will be glad to participate then.)

EDIT: Nevermind about updating. Looks like we can git clone on a particular commit. git clone https://github.com/angusmcleod/discourse-ratings.git && cd $home/plugins/discourse-ratings && git reset --hard de2158f6625d0abad60676db32ec841c3951aa01. Will try & pray that no issues arise.

Hey @Arkshine

Thanks for pushing on this. I’ve just pushed two updates to the plugin that address the issues you’ve raised, and am testing them currently on try.thepavilion.io

You’re right to point out we haven’t followed our own policy on this plugin. Part of the reason we haven’t is because we aren’t getting paid to, and we maintain many open source plugins. We try our best to maintain everything according to our new policy, however it’s still a work in progress.

However, it seems you are getting paid in relation to this plugin. Would you be interested in helping to maintain it?

edit I would advise against pinning the plugin to a specific commit manually unless you’re also pinning Discourse to a release or commit.

1 Like

@Arkshine On our end I’m going to be taking over as temporary maintainer of this plugin.

You’re a dev. If you want to help out with maintenance, let me know and we can chat about that.

@Arkshine Editing (and removing) ratings now works as expected in the new version of the plugin (with multiple ratings). Please use this version instead of the old version. The old version is much more likely to break with updates to Discourse.

You can test it further here:

https://try.thepavilion.io/c/ratings/13

2 Likes

Hey,

I’m doing general dev stuff for my client and managing all his servers. Not necessarily specific to this plugin. Ratings is well involved in his business though.

Unfortunately, ruby and discourse internal are not my forte (yet!). I would have already contributed if I could. I might once I’m confident enough!

To keep Discourse updated and downtime low, not much the choice. I’m not going to update plugin in a broken state. Will keep in mind though. Hopefully I can’t remove it once the plugin is fixed.


About the plugin. Deleting seems to work now! Thanks.
There are few things I noticed:

  • Toggling checkbox doesn’t show/hide the stars anymore. Not sure if intended. It’s a bit confusing. Like you toggle off, you save, and when you edit again, you see the old value (if anything, rating value should be reset, sounds like a minor bug)
  • A minimal dev documentation on meta would have been nice since it changes fields names/structure (we are using the API, so a compatibility upgrade is needed first, now it’s too late for me, but more a general suggestion for the others users)

Thanks for fixing the plugin, it’s appreciated.

1 Like