Repository navigation
FEATURE: Reopen the wizard when a moderator asks to revise a queued topic - #338
Conversation
…opic When a wizard topic needs approval and a moderator chooses "Revise", core rejects it and sends the author the raw post, to be posted again with the composer. That loses the wizard's structure, so the author has to fill the whole wizard in again. Instead, copy the submitted answers into a new draft of the wizard and send a message with the moderator's reason and feedback and a link to the wizard, which opens prefilled. Submitting it queues the corrected topic again. Falls back to the core message when the wizard can't be reopened (e.g. it doesn't allow multiple submissions or doesn't save submissions). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
I'm a little unclear why this is different from when a normal topic needs revision? I understand the user has created the topic in the wizard, but why do they need to edit it in the wizard? Also custom wizard topics have never been designed to work directly with the review queue, so this is a new feature. If you could describe the use case and need for this feature a bit more clearly. Thanks! |
|
Thanks Angus, fair question. Here's the concrete case. The use case. We run a community where members publish structured "information documents" through a wizard: 7 steps, around 45 fields (text, dates, dropdowns, a checkbox list, several composer fields, 6 uploads), plus required category and tag fields. The create_topic action assembles all of this into the post through a post_template. The category requires approval, so every one of these topics goes through the review queue. Why it differs from a normal topic. With a normal topic, the raw text in the revision message is what the author actually wrote, so they can fix it and post it again. With a wizard topic, the raw text is the output of the template, not the author's input. To revise it in the composer, the author would have to:
In practice our members don't post in that category with the composer at all: the wizard is the posting interface there. When a moderator asks for a small change, like a wrong date or a missing attachment, the author either rebuilds 45 fields from scratch or posts something that no longer matches the format. Both are bad outcomes, and moderators stop using Revise because of it. What the PR does. When Revise is used on a queued topic that came from a wizard with multiple submissions enabled, the author's original answers are copied into a new draft of the wizard, and the system message links to /w/. The author fixes only what the moderator asked for, and the topic goes through the same action and validations as before. Every other case falls back to core behaviour, which stays unchanged. I know the review queue wasn't part of the wizard's original design. That's partly why I kept the change small and limited to this one path. If you'd rather not change the default behaviour, I'm happy to put it behind a wizard-level or site setting (off by default). Either way works for us. |
- Add the custom_wizard_reopen_on_revise site setting (off by default). - Never overwrite a draft with answers; send the core message instead. - Require the wizard id in the payload; drop the plugin store lookup. - Use Dsa::AppealInstructions directly and Discourse.warn_exception. - Test through the step endpoints so submissions are actually submitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Perform revise, approve and reject through the review endpoint, with and without DSA reporting. - Fall back to the core message when reopening the wizard fails or the topic was posted as another user. - Check upload, category, tag and composer fields are prefilled and resubmitted. - Add a system spec for the whole flow, from the review queue to the corrected topic being queued again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the explanation. I've made some updates. Let me know if those work for you and we can get this merged. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks Angus, the changes work for us. I tested the updated branch locally: the full plugin suite passes, and so does the new system spec, which covers the whole flow from Revise in the review queue to the corrected topic being queued again. The opt-in setting and keeping an existing draft both make sense. We'll turn the setting on for our site. Happy for this to be merged. |
|
Thanks Angus, we really appreciate it. |
When a wizard topic needs approval and a moderator chooses Revise in the review queue, core rejects the queued post and sends the author a message with the raw post, asking them to post it again. The topic never existed,
so there is nothing to edit, and posting the raw text with the composer loses the wizard's structure (category and tag fields, uploads, validations). In practice the author has to fill in the whole wizard again.
This PR handles Revise on queued wizard topics differently:
queue_topicstores the wizard id in the reviewable payload (next towizard_custom_fields, which already holds the submission id).CustomWizard::Submission.reopencopies the submitted answers into a new draft of the wizard.Submitting it queues the corrected topic again.
queued before this change (without the wizard id in the payload) are handled by looking the submission up across the user's wizard submissions.
The message is a new
system_messages.custom_wizard_revise_queued_topicstring (English and Italian).Testing
spec/extensions/reviewable_queued_post_spec.rb: prefilled draft and message, resubmission queues the corrected topic, lookup without the wizard id, fallback for single-submission wizards, other queued topics left tocore.
spec/system/wizard_step_spec.rb, which needs Chromium (not available in my container).the corrected topic was queued again with the same uploads, category and tags.