[Fusionforge-commits] r12715 - branches/Branch_5_1/src/common/tracker

Alain Peyrat aljeux at fusionforge.org
Fri Mar 11 22:07:52 CET 2011


Author: aljeux
Date: 2011-03-11 22:07:52 +0100 (Fri, 11 Mar 2011)
New Revision: 12715

Modified:
   branches/Branch_5_1/src/common/tracker/ArtifactExtraFieldElement.class.php
Log:
Clean artifact_workflow_event table when a custom status is removed

Modified: branches/Branch_5_1/src/common/tracker/ArtifactExtraFieldElement.class.php
===================================================================
--- branches/Branch_5_1/src/common/tracker/ArtifactExtraFieldElement.class.php	2011-03-11 21:07:42 UTC (rev 12714)
+++ branches/Branch_5_1/src/common/tracker/ArtifactExtraFieldElement.class.php	2011-03-11 21:07:52 UTC (rev 12715)
@@ -306,12 +306,13 @@
 
 		$result = db_query_params ('DELETE FROM artifact_extra_field_elements WHERE element_id=$1',
 				    array ($this->getID())) ;
-		if ($result && db_affected_rows($result) > 0) {
-			return true;
-		} else {
+		if (! $result || ! db_affected_rows($result)) {
 			$this->setError(db_error());
 			return false;
 		}
+		$result = db_query_params ('DELETE FROM artifact_workflow_event WHERE from_value_id=$1 OR to_value_id=$1',
+				    array ($this->getID())) ;
+		return true;
 	}
 }
 




More information about the Fusionforge-commits mailing list