From 68d43b73d24f51839efd3d3d97323507e11ff3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Thu, 30 Jul 2009 16:58:53 +0200 Subject: [PATCH] bug: Prevent duplicates when moving bug links --- include/bugs.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/bugs.php b/include/bugs.php index 9c38fa8..45a3887 100644 --- a/include/bugs.php +++ b/include/bugs.php @@ -181,6 +181,11 @@ class Bug { $oBug = new bug($this->iLinkId); + // There is no need to have two links to a bug. The update is still + // considered successful + if($this->isDuplicate()) + return $this->delete(); + if($this->iVersionId && $this->iVersionId != $oBug->iVersionId) { $hResult = query_parameters("UPDATE buglinks SET versionId = '?'