Permalink
Browse files

Correct tag retrieval on SQL Server when no tags are defined

Fix #13363 : Application Failure when trying to select an issue
  • Loading branch information...
1 parent 61c7a98 commit 59b1fff943f39dc5ffd7594780ddac4b793f9505 @rombert rombert committed Sep 30, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 core/tag_api.php
View
@@ -421,6 +421,11 @@ function tag_get_candidates_for_bug( $p_bug_id ) {
while( $row = db_fetch_array( $result ) ) {
$t_subquery_results[] = (int)$row;
}
+
+ if ( count ( $t_subquery_results ) == 0 ) {
+ return array();
+ }
+
$query = "SELECT id, name, description FROM $t_tag_table WHERE id IN ( " . implode( ', ', $t_subquery_results ) . ')';
} else {
$query = "SELECT id, name, description FROM $t_tag_table WHERE id IN (

0 comments on commit 59b1fff

Please sign in to comment.