Skip to content

Commit

Permalink
Tag candidate query was not selecting tags attached to zero bugs.
Browse files Browse the repository at this point in the history
Follow-up to commit e41119d, a2294e9, and 8ed85ce6.
  • Loading branch information
amyreese committed Feb 27, 2009
1 parent 0234c77 commit 2839af4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/tag_api.php
Expand Up @@ -413,8 +413,11 @@ function tag_get_candidates_for_bug( $p_bug_id ) {
$t_params = array();
if ( 0 != $p_bug_id ) {
$t_bug_tag_table = db_get_table( 'mantis_bug_tag_table' );
$query = "SELECT t.id, t.name, t.description FROM $t_tag_table t
WHERE t.id IN ( SELECT tag_id FROM $t_bug_tag_table WHERE bug_id != " . db_param() . ' )';
$query = "SELECT id, name, description FROM $t_tag_table WHERE id IN (
SELECT t.id FROM $t_tag_table t
LEFT JOIN $t_bug_tag_table b ON t.id=b.tag_id
WHERE b.bug_id IS NULL OR b.bug_id != " . db_param() .
')';
$t_params[] = $p_bug_id;
} else {
$query = 'SELECT id, name, description FROM ' . $t_tag_table;
Expand Down

0 comments on commit 2839af4

Please sign in to comment.