AJDurant
(Andy Durant)
2020 年 12 月 3 日午後 1:53
272
This was occurring on all topics, not just QnA ones. We have a ‘Questions’ category when all topics are QnA, and also have the ‘question’ tag to make a topic QnA.
The behavior is slightly different now though, before the sort order they were given fixed them at the bottom of the list, now they are still out of order, but newer posts are below them.
「いいね!」 1
angus
(Angus McLeod)
2020 年 12 月 4 日午前 2:19
273
Thanks @AJDurant .
One of our clients experienced this issue, so I was able to take a closer look at a dataset where it was occuring. I believe one issue here might be the when topics where a QA tag is removed are handled.
I’ve started a PR that addresses this issue, which @mbcahyono and I will work on
master ← qa_tag_fixes
merged 01:13AM - 08 Dec 20 UTC
@muhlisbc I think how the plugin handles tags might be part of the issue people … are seeing. We don't currently handle re-ordering after a tag is added or removed. This uses the same approach as we use in category custom fields and also creates a topic-specific job for re-ordering. This is a WIP that you'll need to finish off, but I thought we could discuss.
What do you think?
The way to fix the issue for a specific topic is:
./launcher enter app
rails c
topic = Topic.find(<topic_id>)
topic.posts.each { |p| p.update_columns(sort_order: p.post_number) }
If anyone needs any more hands on help addressing this issue on their server please reach out to me privately and I can help you address it (no charge).
「いいね!」 1
Sorry for not responding sooner. I’ve been traveling this week. I can confirm your code above is fixing the individual posts with issues.
I also confirmed that running the following command does NOT fix the problem
rake "posts:reorder_posts[1234]"
Is there a way to run this across all posts - basically loop over all posts?
angus
(Angus McLeod)
2020 年 12 月 5 日午前 8:46
275
And you’ve just run rake posts:reorder_posts by itself and it doesn’t work? Please try that again first.
If that doesn’t work you can run this
./launcher enter app
rails c
Post.update_all("sort_order = post_number")
We have figured out what the issue is. It was introduced back in August. We’ll push a fix for it shortly, with a test for the case.
@muhlisbc I've figured out what the bug is. [This](https://github.com/pavilionde… v/discourse-question-answer/blob/master/extensions/post_extension.rb#L59)
```
def comments
Post
.where(reply_to_post_number: self.post_number)
.order('post_number ASC')
end
```
List all posts with the reply_to_post_number of the current post number across all topics. That's potentially thousands of posts as many posts can have the same ``reply_to_post_number`` across different topics.
So when the comments are iterated over in the ordering function they will be iterated potentially thousands of times throwing off the count.
We need to restrict that Post query to posts in the same topic, and then add a test for this case.
Introduced here https://github.com/paviliondev/discourse-question-answer/commit/d2b1fdc629536f0b0dbe140fa4a0de4677aa640e.
「いいね!」 2
angus:
rake posts:reorder_posts
I ran the above command and got the following error
root@REMOVE-web-only:/var/www/discourse# rake posts:reorder_posts
rake aborted!
PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "post_timings_unique"
DETAIL: Key (topic_id, post_number, user_id)=(1567, 20, 3) already exists.
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-2.2.0/lib/patches/db/pg.rb:110:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rack-mini-profiler-2.2.0/lib/patches/db/pg.rb:110:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mini_sql-0.3/lib/mini_sql/postgres/connection.rb:201:in `run'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mini_sql-0.3/lib/mini_sql/postgres/connection.rb:173:in `exec'
/var/www/discourse/lib/tasks/posts.rake:368:in `block (3 levels) in <main>'
/var/www/discourse/lib/tasks/posts.rake:351:in `each'
/var/www/discourse/lib/tasks/posts.rake:351:in `block (2 levels) in <main>'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.3/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `block in transaction'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.3/lib/active_record/connection_adapters/abstract/transaction.rb:280:in `block in within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.3/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.3/lib/active_record/connection_adapters/abstract/transaction.rb:278:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.3/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activerecord-6.0.3.3/lib/active_record/transactions.rb:212:in `transaction'
/var/www/discourse/lib/tasks/posts.rake:312:in `block in <main>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => posts:reorder_posts
(See full trace by running task with --trace)
I did not run the second command once I saw the duplicate key error thinking that might be a larger issue.
angus
(Angus McLeod)
2020 年 12 月 6 日午前 1:33
277
That looks like an issue with your db that’s independent of this, but blocking a fix here. I’ll pm you shortly and we can debug that seperately.
「いいね!」 2
AJDurant
(Andy Durant)
2020 年 12 月 11 日午後 1:40
278
Thanks @angus that all seems to be working correctly now
mbcahyono
(Muhlis Cahyono)
2020 年 12 月 12 日午前 3:47
280
Sorry for the issue. Working on it, waiting to be merged:
master ← beta
merged 10:33PM - 13 Dec 20 UTC
Issue: https://meta.discourse.org/t/question-answer-plugin/56032/279
「いいね!」 1
sunjam
(james.network)
2020 年 12 月 31 日午後 6:17
281
Cool, I’m excited to see this merged and look forward to the fix. Happy Holidays.
Marcin_J
(Marcin J)
2021 年 4 月 6 日午後 1:44
283
What is the role of the “QnA one-to-many format.” setting that can be found in category settings?
「いいね!」 1
angus
(Angus McLeod)
2021 年 4 月 7 日午前 12:31
284
It’s a deprecated feature, which we’ll be removing from the QnA Plugin in the near future. That feature now has it’s own dedicated plugin
The Journal Plugin lets you create topics as “journals” with a one-to-many structure, where only the original poster can make “entries” and everyone else can make “comments” on those entries. This plugin was a community effort and sponsored by...
Reading time: 1 mins 🕑
Likes: 2 ❤
「いいね!」 2
Marcin_J
(Marcin J)
2021 年 4 月 9 日午前 10:12
285
How do you remove your vote? In options, there is a configuration of how much time you have to undo the vote, but I don’t see a way how to actually do that.
「いいね!」 1
Are there any good examples of this plugin in use in the wild? I’d love to see it in action!
Select the yellow “Undo your upvote” text - see screenshot below.
I noticed a few feedback items:
up icon to vote is not respecting dark theme (see screenshot)
placement of my flair on comments on answers is off (see screenshot)
styling of the info button is not bad but it doesn’t really match the rest of the page and takes up some horizontal space. Maybe a different approach, e.g. a small text link in the top right corner or next to the category and tag would work better?
“Undo your upvote” link is not obviously a link
qa trust level vote limits admin setting is deselected by default, but I still get an error “You cannot exceed the number of votes for your trust level” which doesn’t maek sense?
Is there only a ‘Comment’ button on first post and the replies don’t show that button on bottom?
That’s OK by design or there is a bug in my theme?
Upvoting is missaligned, I think that could be fixed by CSS (I will try to do it).
Thanks!
Can we recover the normal order of posts uninstalling the plugin?
I see that previous reported bug really messy our conversations
angus
(Angus McLeod)
2021 年 10 月 21 日午前 3:02
290
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
このプラグインをありがとうございます! 1つ質問があります。プラグインが削除された場合、コンテンツはどうなりますか? 投票と返信の特別な並べ替えはなくなりますが、「返信」と各返信への「コメント」はどうなりますか? それらは残りますか、それともなくなりますか?
お尋ねする理由は、共同ユーザーガイドの作成にこのプラグインを使用し始めたからです。各返信にコメントがあるのは非常に便利です。投票も有望ですが、意図しない結果を招き、削除したい場合はどうなりますか? 投票を削除したいがためにガイドを失うのは残念です。
最悪の場合、CSSで投票UIを削除し、プラグインを残しておくことができると思います。
「いいね!」 1
angus
(Angus McLeod)
2021 年 11 月 29 日午前 9:51
292
素晴らしい質問ですね。
コメントと回答は、単に表示順が異なるだけの投稿です。保持されます。
プラグインをアンインストールしたい場合は、カテゴリ設定で「このカテゴリのすべてのトピックをQnAにする」のチェックを外すだけです。これにより、すべての投稿が元の順序に戻ります。
例えば、try.thepavilion.io の QnA カテゴリを標準の順序(つまり、時系列順(24時間後に元に戻ります))に元に戻しました。
https://try.thepavilion.io/t/whats-it-like-to-be-a-bat/22
「いいね!」 2
これを踏まえて、プラグインを試してみます。もし投票がその目的を果たせなければ、それらを削除するには2つの選択肢があります。CSSによる軽量な方法と、プラグインを無効化する重い方法です。コンテンツの損失はありません。Discourseコアコンポーネントの素晴らしい適応です!
ちなみに、ご興味があればお伝えしますが、私たちはあなたのプラグインを使用して製品の共同ビデオガイドを作成しています。人々はこの製品に関する作成されたビデオへのリンクを招待されています。動作するように、いくつかのラベルをカスタマイズしました。Bitwig Video Guide - Bitwish をご覧ください(まだ始まったばかりなので、ほとんど空の状態です。また、ほとんどのサブカテゴリはミュートされているため、匿名ユーザーにはより空っぽに見えます)。
「いいね!」 3