Commit 19630bdb authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 277417: SQL error when reloading the page after changing the bug resolution…

Bug 277417: SQL error when reloading the page after changing the bug resolution to duplicate - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=justdave
parent a41ac397
......@@ -1038,6 +1038,16 @@ SWITCH: for ($cgi->param('knob')) {
ThrowUserError("dupe_of_self_disallowed");
}
# Make sure the bug is not already marked as a dupe
# (may appear in race condition)
my $dupe_of =
$dbh->selectrow_array("SELECT dupe_of FROM duplicates
WHERE dupe = ?",
undef, $cgi->param('id'));
if ($dupe_of) {
ThrowUserError("dupe_entry_found", { dupe_of => $dupe_of });
}
# DUPLICATE bugs should have no time remaining.
_remove_remaining_time();
......
......@@ -326,6 +326,11 @@
[% title = "Description Required" %]
You must provide a description of the [% terms.bug %].
[% ELSIF error == "dupe_entry_found" %]
[% title = "Already marked as duplicate" %]
This [% terms.bug %] has already been marked as a duplicate
of [% terms.bug %] [%+ dupe_of FILTER html %].
[% ELSIF error == "dupe_of_self_disallowed" %]
[% title = "Cannot mark $terms.abug as a duplicate of itself" %]
You can't mark [% terms.abug %] as a duplicate of itself.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment