Skip to content

Commit 49ac759

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 d95eeae commit 49ac759

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
@@ -2026,7 +2026,8 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
20262026
if ( !$t_first ) {
20272027
$t_join_clauses[] = "JOIN $t_bug_text_table ON $t_bug_table.bug_text_id = $t_bug_text_table.id";
20282028
$t_join_clauses[] = "LEFT JOIN $t_bugnote_table ON $t_bug_table.id = $t_bugnote_table.bug_id";
2029-
$t_join_clauses[] = "JOIN $t_bugnote_text_table ON $t_bugnote_table.bugnote_text_id = $t_bugnote_text_table.id";
2029+
# Outer join required otherwise we don't retrieve issues without notes
2030+
$t_join_clauses[] = "LEFT JOIN $t_bugnote_text_table ON $t_bugnote_table.bugnote_text_id = $t_bugnote_text_table.id";
20302031
$t_where_clauses[] = $t_textsearch_where_clause;
20312032
}
20322033
}

0 commit comments

Comments
 (0)
Please sign in to comment.