Krzysztof Kotlarek
5830f2c9a1
FIX: double reviewable items bug ( #28161 )
...
When `SiteSetting.review_every_post` is true and the category `require_topic_approval` system creates two reviewable items.
1. Firstly, because the category needs approval, the `ReviewableQueuePost` record` is created - at this stage, no topic is created.
2. Admin is approving the review. The topic and first post are created.
3. Because `review_every_post` is true `queue_for_review_if_possible` callback is evaluated and `ReviewablePost` is created.
4. Then `ReviewableQueuePost` is linked to the newly generated topic and post.
At the beginning, we were thinking about hooking to those guards:
```
def self.queue_for_review_if_possible(post, created_or_edited_by)
return unless SiteSetting.review_every_post
return if post.post_type != Post.types[:regular] || post.topic.private_message?
return if Reviewable.pending.where(target: post).exists?
...
```
And add something like
```
return if Reviewable.approved.where(target: post).exists?
```
However, because the callback happens in point 3. before the `ReviewableQueuePost` is linked to the `Topic`, it was not possible.
Therefore, when `ReviewableQueuePost` is creating a `Topic`, a new option called `:reviewed_queued_post` is passed to `PostCreator` to avoid creating a second `Reviewable`.
2024-07-31 12:45:00 +10:00
..
2024-04-12 13:14:19 +02:00
2024-07-04 10:58:21 +02:00
2024-03-01 10:07:35 +10:00
2023-12-04 13:45:19 +01:00
2023-01-09 11:49:28 +00:00
2024-03-20 10:49:28 +01:00
2024-03-14 18:50:09 +00:00
2024-05-06 20:52:48 +02:00
2024-07-18 10:33:14 +10:00
2023-11-09 16:47:59 -06:00
2024-07-03 20:49:15 +08:00
2024-07-03 20:49:15 +08:00
2024-06-05 13:27:06 +10:00
2023-01-09 11:49:28 +00:00
2023-05-24 08:59:37 +08:00
2024-05-28 13:57:09 +10:00
2023-01-09 11:49:28 +00:00
2024-07-03 10:38:49 +10:00
2024-07-04 10:58:21 +02:00
2024-07-30 14:19:01 +08:00
2024-07-11 10:51:48 +02:00
2024-02-12 12:07:14 +02:00
2023-01-09 11:49:28 +00:00
2024-02-07 13:47:50 -06:00
2024-01-29 12:28:47 +00:00
2024-05-27 09:57:30 +02:00
2024-06-19 09:32:30 +10:00
2024-03-15 14:24:11 +08:00
2023-11-09 16:47:59 -06:00
2024-04-04 12:01:31 +08:00
2023-11-02 08:10:15 +03:00
2024-01-25 14:28:26 +08:00
2023-12-14 11:11:11 +08:00
2024-06-21 17:00:22 +08:00
2024-07-29 14:07:06 +08:00
2023-11-09 16:47:59 -06:00
2023-01-09 11:49:28 +00:00
2024-05-24 22:15:53 +08:00
2023-11-09 16:47:59 -06:00
2023-11-09 16:47:59 -06:00
2023-11-09 16:47:59 -06:00
2024-05-28 10:21:33 -03:00
2023-01-09 11:49:28 +00:00
2024-07-30 09:08:12 +02:00
2024-02-13 10:18:36 -05:00
2023-11-09 16:47:59 -06:00
2023-02-01 09:55:21 +00:00
2024-05-23 12:19:07 +10:00
2023-01-09 11:49:28 +00:00
2024-06-21 17:00:22 +08:00
2024-06-18 10:47:18 +02:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2024-02-25 10:42:50 +05:30
2024-07-30 11:33:20 +08:00
2024-06-10 15:51:48 +01:00
2024-07-23 06:27:43 +08:00
2024-02-01 11:48:31 +00:00
2023-12-04 13:45:19 +01:00
2023-01-09 11:49:28 +00:00
2024-01-08 09:57:25 +10:00
2024-05-01 20:01:39 -05:00
2024-02-23 11:42:28 +05:30
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-11-13 10:34:06 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-07-28 09:07:53 -06:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-11-09 16:47:59 -06:00
2024-05-16 08:37:34 +08:00
2024-07-18 10:10:22 +10:00
2023-01-09 11:49:28 +00:00
2023-08-02 10:46:37 +08:00
2023-06-26 10:09:57 +05:30
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-11-09 16:47:59 -06:00
2024-05-29 14:39:58 +10:00
2023-01-09 11:49:28 +00:00
2024-07-04 10:58:21 +02:00
2024-06-20 11:33:46 -04:00
2023-01-09 11:49:28 +00:00
2024-06-10 16:03:30 +02:00
2023-01-09 11:49:28 +00:00
2023-11-29 16:38:07 +11:00
2024-07-30 09:56:46 +08:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2024-05-28 13:57:09 +10:00
2023-08-02 10:46:37 +08:00
2023-01-09 11:49:28 +00:00
2023-01-16 17:28:59 +00:00
2024-01-29 17:52:02 +08:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2024-07-24 04:45:30 +05:30
2023-01-09 11:49:28 +00:00
2023-04-11 10:16:28 +01:00
2023-01-09 11:49:28 +00:00
2023-12-04 13:45:19 +01:00
2023-01-09 11:49:28 +00:00
2024-03-26 11:41:12 +08:00
2023-12-13 17:18:42 +08:00
2024-07-31 12:45:00 +10:00
2024-03-26 11:41:12 +08:00
2023-06-26 11:41:52 +02:00
2023-11-09 16:47:59 -06:00
2023-11-09 16:47:59 -06:00
2024-05-23 12:19:07 +10:00
2023-11-09 16:47:59 -06:00
2024-07-30 14:19:01 +08:00
2023-03-30 13:52:10 +10:00
2023-08-10 02:03:38 +02:00
2023-06-26 11:01:59 +08:00
2023-11-09 16:47:59 -06:00
2023-12-01 15:03:06 +08:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2024-06-10 13:16:00 +08:00
2024-07-19 14:22:58 +08:00
2023-01-09 11:49:28 +00:00
2023-11-09 16:47:59 -06:00
2024-07-18 16:33:14 -03:00
2023-12-06 23:25:00 +01:00
2024-01-25 09:50:59 +10:00
2024-04-25 13:21:39 -05:00
2024-06-13 14:24:44 +08:00
2024-06-13 06:38:03 +08:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2024-07-04 10:58:21 +02:00
2023-01-09 11:49:28 +00:00
2024-01-25 14:28:26 +08:00
2024-06-13 12:19:26 +02:00
2023-11-09 16:47:59 -06:00
2023-11-09 16:47:59 -06:00
2023-01-09 11:49:28 +00:00
2024-07-22 17:35:52 +02:00
2023-01-09 11:49:28 +00:00
2024-06-10 15:51:48 +01:00
2024-02-08 12:59:52 +08:00
2024-04-30 16:45:07 +08:00
2023-12-06 23:25:00 +01:00
2024-04-04 15:02:09 +02:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2024-03-27 12:56:21 +03:00
2023-11-09 16:47:59 -06:00
2024-07-01 17:08:48 -03:00
2023-02-28 14:31:59 +02:00
2023-06-26 11:41:52 +02:00
2024-04-29 16:11:12 +02:00
2024-01-26 13:25:03 +08:00
2024-07-20 00:58:29 +04:00
2023-02-07 15:28:59 -03:00
2023-10-16 10:34:38 -04:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2023-01-09 11:49:28 +00:00
2024-05-07 16:56:05 +02:00
2023-01-09 11:49:28 +00:00
2024-01-25 09:50:59 +10:00
2023-12-04 13:45:19 +01:00
2024-04-30 16:45:07 +08:00
2023-06-26 11:41:52 +02:00
2023-01-09 11:49:28 +00:00
2023-12-04 13:45:19 +01:00
2023-09-12 15:31:31 -03:00
2024-02-07 13:47:50 -06:00