nuclear_eclipse | 7 Oct 16:11

SF.net SVN: mantisbt:[5634] trunk/mantisbt/core/category_api.php

Revision: 5634
          http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5634&view=rev
Author:   nuclear_eclipse
Date:     2008-10-07 14:15:13 +0000 (Tue, 07 Oct 2008)

Log Message:
-----------
Fix #9677: SQL errors when deleting categories from projects with no categories.

Modified Paths:
--------------
    trunk/mantisbt/core/category_api.php

Modified: trunk/mantisbt/core/category_api.php
===================================================================
--- trunk/mantisbt/core/category_api.php	2008-10-07 12:53:37 UTC (rev 5633)
+++ trunk/mantisbt/core/category_api.php	2008-10-07 14:15:13 UTC (rev 5634)
@@ -223,6 +223,12 @@
 		while( $t_row = db_fetch_array( $t_result ) ) {
 			$t_category_ids[] = $t_row['id'];
 		}
+
+		# Handle projects with no categories
+		if ( count( $t_category_ids ) < 1 ) {
+			return true;
+		}
+
 		$t_category_ids = join( ',', $t_category_ids );

 		# update bug history entries

This was sent by the SourceForge.net collaborative development platform, the world's largest Open
Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane