Question Answer Plugin

Yes there seems to be a conflict between this plugin and the Solved Plugin, i.e. the “Solution” element in your screenshot. This plugin does not yet offiically support the Solved Plugin.

Yes, you just need to disable the plugin in a category in which its enabled and the posts will go back to their normal order.

1 Like

Thank you for this plugin! One question, what happens to the content if the plugin is removed? It is clear that the votes and the special sorting of replies will be gone, but what would happen to the “replies” and “comments” for each reply? Will they stay are will they gone?

My reason to ask is that we have started using this plugin to build a collaborative user guide. Having comments for each reply is very convenient. The votes are promising too, but what if they come with unintended consequences and we want to get rid of them? It would be a pity to lose the guide because we want to remove the votes.

Worst case scenario, I guess we could remove the vote UI via CSS, keeping the plugin there.

1 Like

Great question.

Comments and answers are just posts showing up in a different order. They will be retained.

If you want to uninstall the plugin just uncheck “Make all topics in this category QnA” in the category settings. This will revert all of the posts to their original order.

For example I just reverted the QnA category on try.thepavilion.io to its standard order (i.e. chronological (will change in back in 24 hours).

2 Likes

Ok, knowing this is encouraging. We will try the plugin, and if the votes don’t fulfill their mission then we will have two options to remove them: the light one via CSS and the heavy one disabling the plugin. No content lost. Great adaptation of Discourse core components!

By the way, just in case you are curious, we are using your plugin to create a collaborative video guide of a product, where people are invited to link to videos that people have created about aspects of this product. We have customized a couple of labels to make it work. See Bitwig Video Guide - Bitwish (we have just started, so it is mostly empty; also, most subcategories are muted and this is why it looks emptier for anonymous users).

3 Likes

So we had great success with one of our experiments:

Multiple entries, and several entries are getting additional comments. Interestingly, the upvoting itself hasn’t been used much, but maybe it is because this is a new idea and people are not used to it.

Now, one problem that we didn’t expect was that, with all this activity, it isn’t easy to find new comments, except for the very last (because it is the one being linked to from the timeline). Are we missing something, like a hidden alternative way to see the posts chronologically? Or any thoughts, advice?

1 Like

Has anyone tried to create an SQL query to grant a badge to anyone who has submitted at least one answer that received at least one upvote on a specific category? Examples of queries with more answers and/or more upvotes would be very useful to create silver and gold types of badges around this great plugin. :slight_smile:

1 Like

Like many before me, been looking for a SO-like Q&A site that is based on a solid foundation, opensource, with an active & vibrant community, and Discourse seems to be a natural fit (nearly) with it’s plugins.

Then found mention of your plugin in another thread, and this looks really very promising reading some of the posts above. Wondering if there is a site that uses latest/nearly-latest Discourse with this plugin (and hopefully not much else) to get a feel of how this plugin works & feels ?

Angus,

We need to figure out if we “retire” this and move it to #plugin:broken-plugin or if you would like to keep this as is and maintain long term.

The official Q&A plugin (which is inspired by much of this) is now ready for beta. So we need to figure out what to do with this plugin.

3 Likes

We’ll retire this one. When the new one is released, you can move this to #plugin:broken-plugin and put a notice directing people to the new one. I’ll also update the repo readme.

If there’s a need for a migration script, I’ll be happy to write that, but only if there’s a need amongst existing users of this plugin (please let me know if that’s you).

5 Likes

Hey Angus,

I just published a new topic for the official Discourse Question Answer plugin:

4 Likes

I have a customer that is going to need it.

Seemed to be interested. No. I think they just mean an existing normal topic. I’m a bit surprised that this isn’t solved, or perhaps all I need to do is to install Discourse Upvotes and it’ll just work?

I don’t see any rake tasks in the new plugin, and glancing at the migrations it doesn’t appear that there is any magic there, though I could be wrong on one or both counts.

EDIT: OOps. It does look like the first migration handles moving stuff to the new plugin right here. . . I’m running the upgrade now and will delete this when it works.

EDIT 2: Sigh. It didn’t work. It’s failing with "PG::InvalidParameterValue: ERROR: cannot extract elements from a scalar",

Here’s the problem. A bunch of the post_custom_fields look like this:

  "\"[\\\"[{\\\\\\\"direction\\\\\\\":\\\\\\\"up\\\\\\\",\\\\\\\"action\\\\\\\":\\\\\\\"create\\\\\\\",\\\\\\\"user_id\\\\\\\":51,\\\\\\\"created_at\\\\\\\":\\\\\\\"2018-11-02T14:21:49.785+00:00\\\\\\\"}]\\\",{\\\"direction\\\":\\\"up\\\",\\\"action\\\":\\\"create\\\",\\\"user_id\\\":61,\\\"created_at\\\":\\\"2018-11-15T18:49:43.875+00:00\\\"}]\"",

rather than, maybe, this

 "[{\"direction\":\"up\",\"action\":\"create\",\"user_id\":6,\"created_at\":\"2018-07-18T16:37:42.446+00:00\"}]",

Some are worse:

 "\"[\\\"[\\\\\\\"[\\\\\\\\\\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":21,\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"created_at\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"2018-11-15T18:41:52.440+00:00\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"}]\\\\\\\\\\\\\\\",{\\\\\\\\\\\\\\\"direction\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"up\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"action\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"destroy\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"user_id\\\\\\\\\\\\\\\":21,\\\\\\\\\\\\\\\"created_at\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"2018-11-15T18:41:56.158+00:00\\\\\\\\\\\\\\\"}]\\\\\\\",{\\\\\\\"direction\\\\\\\":\\\\\\\"up\\\\\\\",\\\\\\\"action\\\\\\\":\\\\\\\"create\\\\\\\",\\\\\\\"user_id\\\\\\\":3,\\\\\\\"created_at\\\\\\\":\\\\\\\"2019-05-17T17:21:51.066+00:00\\\\\\\"}]\\\",{\\\"direction\\\":\\\"up\\\",\\\"action\\\":\\\"create\\\",\\\"user_id\\\":43,\\\"created_at\\\":\\\"2019-06-01T14:10:48.056+00:00\\\"}]\"",

So I guess I’d need to recursively try to un-quote these a bunch of times until it got back to the right way? I guess I’ll see if I can google the Ruby un-quotify function. . . .

It looks like a real mess:

[24] pry(main)> too.value.gsub(/\\+/,"\\").undump
=> "[\"[\"[\"[\"[\"[\"[{\"direction\":\"up\",\"action\":\"create\",\"user_id\":161,\"created_at\":\"2018-11-14T01:41:18.071+00:00\"}]\",{\"direction\":\"up\",\"action\":\"create\",\"user_id\":21,\"created_at\":\"2018-11-15T18:41:37.215+00:00\"}]\",{\"direction\":\"up\",\"action\":\"destroy\",\"user_id\":21,\"created_at\":\"2018-11-15T18:41:44.680+00:00\"}]\",{\"direction\":\"up\",\"action\":\"create\",\"user_id\":21,\"created_at\":\"2018-11-15T18:41:52.440+00:00\"}]\",{\"direction\":\"up\",\"action\":\"destroy\",\"user_id\":21,\"created_at\":\"2018-11-15T18:41:56.158+00:00\"}]\",{\"direction\":\"up\",\"action\":\"create\",\"user_id\":3,\"created_at\":\"2019-05-17T17:21:51.066+00:00\"}]\",{\"direction\":\"up\",\"action\":\"create\",\"user_id\":43,\"created_at\":\"2019-06-01T14:10:48.056+00:00\"}]"
[25] pry(main)> one.value.gsub(/\\+/,"\\").undump
=> "[\"[{\"direction\":\"up\",\"action\":\"create\",\"user_id\":134,\"created_at\":\"2019-02-11T19:33:22.533+00:00\"}]\",{\"direction\":\"up\",\"action\":\"create\",\"user_id\":213,\"created_at\":\"2019-02-28T15:12:07.776+00:00\"}]"

I can do

SELECT
    post_id,
    jsonb_array_elements(value::jsonb) AS value                                   
  FROM post_custom_fields WHERE name = 'vote_history'
 and value not like '\"[%';
discourse=>   SELECT
    post_id,
    jsonb_array_elements(value::jsonb) AS value
  FROM post_custom_fields WHERE name = 'vote_history'
 and value not like '\"[%';

and get ~200 of ~250 entries, leaving a few that still look something like

    1865 | "[\"[\\\"[{\\\\\\\"direction\\\\\\\":\\\\\\\"up\\\\\\\",\\\\\\\"action\\\\\\\":\\\\\\\"create\\\\\\\",\\\\\\\"user_id\\\\\\\":161,\\\\\\\"created_at\\\\\\\":\\\\\\\"2019-06-28T15:39:44.438+00:00\\\\\\\"}]\\\",{\\\"direction\\\":\\\"up\\\",\\\"action\\\":\\\"create\\\",\\\"user_id\\\":39,\\\"created_at\\\":\\\"2019-07-03T19:29:04.663+00:00\\\"}]\",{\"direction\":\"up\",\"action\":\"create\",\"user_id\":298,\"created_at\":\"2019-07-11T13:51:52.447+00:00\"}]"
1 Like

I’m not sure how you ended up with multi-escaped json, but I would go back to a backup prior to the attempted upgrade, fix any escaping issue in a targeted way and try again using the standard migration.

1 Like

These issues go back years, so a backup isn’t a good solution. The good news is that they don’t seem to have used it much lately (like 3 times this year?), so perhaps I can just remove it.

Thanks.

The only potenially confusing thing is that it’s not clear from the documentation that I see that you can just switch to the new upvote plugin and it’ll “Just Work” (unless it doesn’t, but it looks like that’s not the fault of the most recent version of either plugin.

1 Like

As mentioned in the other topic, essentially you’re experiencing an issue with a migration in the Upvotes Plugin. The ultimate solution here is for that migration to handle edge cases that can arise with Discourse custom fields when used at scale.

I’m trying to count the total amount of upvotes/downvotes in a topic in Data Explorer. Has anyone found the data identifier for upvotes/downvotes to input into the Data Explorer?

This plug-in is broken as of last discourse update. Some js errors that break the message listings inside topics.

1 Like

Thanks for the report. :+1: I’ll swop the tag out.

1 Like

Awesome, thank you for creating this plugin, it’s exactly what i was looking for for my new project. A site that showcases information and allows members to rate them.

Since this plugin is tagged as broken I recomment using Discourse Post Voting

2 Likes