כפתור "תור לבדיקה" עלול לגרום לשגיאה בעת סימון

סיכום מבוסס בינה מלאכותית

A JavaScript error occurs when using the Queue for Review button in the flag modal if the post is hidden or if the user has already flagged it. tshenry provided screenshots and screen recordings demonstrating the issue, tracing the error to a specific line in the code. The team debated whether to hide the button in these scenarios or allow it to always queue posts regardless. vinothkannans confirmed the bug only appears when the same staff user attempts to flag again, and not when different users are involved. They resolved the issue by disabling the button when the action is not permitted, submitting a fix via pull request #13966.

A javascript error is thrown when trying to use the Queue for Review button on the flag modal when the post is hidden, or if you had already flagged the post in the past.

The error can be found in the screenshot below and appears to be pointing to this area of the code.

Repro for queuing a hidden post:

Repro for queuing a post you already had flagged:

For a fix, we’ll need to decide if the Queue for Review button should just not be rendered in those two scenarios, or if it should have the power to always send a post to the review queue.

6 לייקים

I’m unable to replicate this issue until the same staff user already flagged that post. It is working properly if two different users are involved like in the above example.

I fixed the issue by disabling the button when the staff user can’t perform that action.

https://github.com/discourse/discourse/pull/13966

3 לייקים