Skip to content

Commit

Permalink
Fix regression in filter_api.php
Browse files Browse the repository at this point in the history
Commit c9bc064 introduced a regression,
whereby the filter would exclude issues without bugnotes when using text
search.

This was caused by removal of left outer join between bugnote_table and
bugnote_text_table, which was in fact required because the join clause
fails to return any record when the bugnote_text_id is null (which is
the case when there are no bugnotes).

Thanks to user Kitzberger for reporting this and atrol for providing the
steps to reproduce.
  • Loading branch information
dregad committed Apr 11, 2013
1 parent bb6b113 commit cb4e22c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/filter_api.php
Expand Up @@ -2001,7 +2001,8 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
if ( !$t_first ) {
$t_join_clauses[] = "JOIN $t_bug_text_table ON $t_bug_table.bug_text_id = $t_bug_text_table.id";
$t_join_clauses[] = "LEFT JOIN $t_bugnote_table ON $t_bug_table.id = $t_bugnote_table.bug_id";
$t_join_clauses[] = "JOIN $t_bugnote_text_table ON $t_bugnote_table.bugnote_text_id = $t_bugnote_text_table.id";
# Outer join required otherwise we don't retrieve issues without notes
$t_join_clauses[] = "LEFT JOIN $t_bugnote_text_table ON $t_bugnote_table.bugnote_text_id = $t_bugnote_text_table.id";
$t_where_clauses[] = $t_textsearch_where_clause;
}
}
Expand Down

0 comments on commit cb4e22c

Please sign in to comment.