Skip to content

Commit cb4e22c

Browse files
committedApr 11, 2013
Fix regression in filter_api.php
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.
1 parent bb6b113 commit cb4e22c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎core/filter_api.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,8 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
20012001
if ( !$t_first ) {
20022002
$t_join_clauses[] = "JOIN $t_bug_text_table ON $t_bug_table.bug_text_id = $t_bug_text_table.id";
20032003
$t_join_clauses[] = "LEFT JOIN $t_bugnote_table ON $t_bug_table.id = $t_bugnote_table.bug_id";
2004-
$t_join_clauses[] = "JOIN $t_bugnote_text_table ON $t_bugnote_table.bugnote_text_id = $t_bugnote_text_table.id";
2004+
# Outer join required otherwise we don't retrieve issues without notes
2005+
$t_join_clauses[] = "LEFT JOIN $t_bugnote_text_table ON $t_bugnote_table.bugnote_text_id = $t_bugnote_text_table.id";
20052006
$t_where_clauses[] = $t_textsearch_where_clause;
20062007
}
20072008
}

0 commit comments

Comments
 (0)