]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 277417: SQL error when reloading the page after changing the bug resolution to...
authorlpsolit%gmail.com <>
Sat, 11 Jun 2005 02:19:21 +0000 (02:19 +0000)
committerlpsolit%gmail.com <>
Sat, 11 Jun 2005 02:19:21 +0000 (02:19 +0000)
process_bug.cgi
template/en/default/global/user-error.html.tmpl

index 7b0dd6a8a60585dc091c296735959e67c09700f6..34444dfcfc9452a4bffc3bb89dd9c7811d593668 100755 (executable)
@@ -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();
 
index 3d7599711af94ad502f2c4bac76fc72706632a13..d01af23750eb667e680a5d6d837723aae27c384f 100644 (file)
     [% 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.