summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-06-11 04:19:21 +0200
committerlpsolit%gmail.com <>2005-06-11 04:19:21 +0200
commit19630bdbdff44d9286ca489c39d3eaf52f391f5c (patch)
treeb65d0ef9e72726605101e8f077831a2ad655587e
parenta41ac397cb8755475aaeb9221f5de94b90f3df75 (diff)
downloadbugzilla-19630bdbdff44d9286ca489c39d3eaf52f391f5c.tar.gz
bugzilla-19630bdbdff44d9286ca489c39d3eaf52f391f5c.tar.xz
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
-rwxr-xr-xprocess_bug.cgi10
-rw-r--r--template/en/default/global/user-error.html.tmpl5
2 files changed, 15 insertions, 0 deletions
diff --git a/process_bug.cgi b/process_bug.cgi
index 7b0dd6a8a..34444dfcf 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -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();
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index 3d7599711..d01af2375 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -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.