Skip to content

Commit

Permalink
When sorting by due_date, display undefined values last
Browse files Browse the repository at this point in the history
Markus' original patch was modified to simplify the code and reduce
duplication, fix a couple typos in comment text and reword the
commit message.

Fixes #16259
  • Loading branch information
OSguard authored and dregad committed Aug 28, 2013
1 parent 017eca5 commit 7a375d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/filter_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,14 @@ function filter_get_query_sort_data( &$p_filter, $p_show_sticky, $p_query_clause

# standard column
} else {
$p_query_clauses['order'][] = "$t_bug_table.$c_sort $c_dir";
$t_sort_col = "$t_bug_table.$c_sort";

# when sorting by due_date, always display undefined dates last
if( 'due_date' == $c_sort && 'ASC' == $c_dir ) {
$t_sort_col = "$t_sort_col = 1, $t_sort_col";
}

$p_query_clauses['order'][] = "$t_sort_col $c_dir";
}
}
}
Expand Down

0 comments on commit 7a375d6

Please sign in to comment.