[Fusionforge-commits] r8929 - branches/Branch_5_0/gforge/common/tracker

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Wed Mar 3 22:33:55 CET 2010


Author: aljeux
Date: 2010-03-03 22:33:55 +0100 (Wed, 03 Mar 2010)
New Revision: 8929

Modified:
   branches/Branch_5_0/gforge/common/tracker/ArtifactFactory.class.php
Log:
Fix [#98] Tracker queries does not work

Modified: branches/Branch_5_0/gforge/common/tracker/ArtifactFactory.class.php
===================================================================
--- branches/Branch_5_0/gforge/common/tracker/ArtifactFactory.class.php	2010-03-03 21:31:34 UTC (rev 8928)
+++ branches/Branch_5_0/gforge/common/tracker/ArtifactFactory.class.php	2010-03-03 21:33:55 UTC (rev 8929)
@@ -320,14 +320,18 @@
 							array($keys[$i])) ;
 				$type = db_result($res,0,'field_type');
 				if ($type == 4 or $type == 6) {
-					$search = "LIKE '".addslashes($vals[$i])."'";
 					$wheresql .= ' AND aefd'.$i.'.field_data LIKE $'.$paramcount++ ;
 					$params[] = $vals[$i];
 				} else {
-					$wheresql .= ' AND aefd'.$i.'.field_data = ANY ($'.$paramcount++ ;
-					$params[] = db_string_array_to_any_clause ($vals[$i]) ;
+					if (is_array($vals[$i])) {
+						$wheresql .= ' AND aefd'.$i.'.field_data = ANY ($'.$paramcount++ .')' ;
+						$params[] = db_string_array_to_any_clause ($vals[$i]) ;
+					} else {
+						$wheresql .= ' AND aefd'.$i.'.field_data = $'.$paramcount++ ;
+						$params[] = $vals[$i];
+					}
 				}
-				$wheresql .= ') AND aefd'.$i.'.artifact_id=artifact_vw.artifact_id' ;
+				$wheresql .= ' AND aefd'.$i.'.artifact_id=artifact_vw.artifact_id' ;
 			}
 		}
 




More information about the Fusionforge-commits mailing list