You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When someone with the ability to manage the Moderation Queue clicks to approve any number of items in the list, multiple clicks on "Yes" in the confirmation modal results in each item being published multiple times.
Vanilla info
Are you sure this is a core Vanilla problem and not caused by any addon you are using?
We have made no changes to how the moderation queue functions.
Did you follow our generic troubleshooting steps already?
Yes
What Vanilla version are you using?
2021.012
When did the issue start?
Not certain, could have been there since we updated to 2021.012.
To Reproduce
Steps to reproduce the behavior:
Prerequisite: Have at least one item in the Moderation Queue. May require logging on as a normal user to do this depending on the site configuration.
Log in as a user with the ability to manage the Moderation Queue.
Go to the Moderation Queue.
Select one or more items and click "Approve".
In the confirmation modal that pops up, click "Yes" multiple times. We have easily been able to click 4-5 times before errors pop up and/or the modal disappears.
Expected behavior
All selected items are published exactly once and appear exactly once in the appropriate place on the frontend.
Current behavior
All selected items are published the number of times that the "Yes" button was clicked before errors begin to pop up. So if the button was clicked 4 times to approve a new discussion, that new discussion is published 4 times and appears 4 times on the frontend.
Additional context
We have found in applications/dashboard/controllers/class.logcontroller.php in the restore() function that checking for and stashing a session variable seems to be a good way to address this situation. Something like this seems to have worked for us in a patch:
$logIDs = Gdn::request()->post('LogIDs');
// Handle multiple clicks on "Yes" when restoring logs.
$session = Gdn::session();
$restoreIds = $session->stash('restoring_logs', '', false);
if ($restoreIds && $restoreIds === $logIDs) {
// Already restoring these logs, so multiple clicks detected.
return;
} else {
// Not already restoring the logs, so this is the first click.
$session->stash('restoring_logs', $logIDs);
}
....
$this->LogModel->recalculate();
// Now that the logs have been restored, remove the session value so that other logs can be restored.
$session->stash('restoring_logs');
The text was updated successfully, but these errors were encountered:
Describe the bug
When someone with the ability to manage the Moderation Queue clicks to approve any number of items in the list, multiple clicks on "Yes" in the confirmation modal results in each item being published multiple times.
Vanilla info
Are you sure this is a core Vanilla problem and not caused by any addon you are using?
We have made no changes to how the moderation queue functions.
Did you follow our generic troubleshooting steps already?
Yes
What Vanilla version are you using?
2021.012
When did the issue start?
Not certain, could have been there since we updated to 2021.012.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All selected items are published exactly once and appear exactly once in the appropriate place on the frontend.
Current behavior
All selected items are published the number of times that the "Yes" button was clicked before errors begin to pop up. So if the button was clicked 4 times to approve a new discussion, that new discussion is published 4 times and appears 4 times on the frontend.
Additional context
We have found in applications/dashboard/controllers/class.logcontroller.php in the restore() function that checking for and stashing a session variable seems to be a good way to address this situation. Something like this seems to have worked for us in a patch:
The text was updated successfully, but these errors were encountered: