Skip to content

Commit

Permalink
due_date ASC sort: pgsql fix
Browse files Browse the repository at this point in the history
Fix #16259: adding order by expression to select list to avoid error.
  • Loading branch information
dregad committed Aug 28, 2013
1 parent 7a375d6 commit fa52c99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/filter_api.php
Expand Up @@ -958,7 +958,9 @@ function filter_get_query_sort_data( &$p_filter, $p_show_sticky, $p_query_clause

# 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";
$t_sort_due_date = "$t_sort_col = 1";
$p_query_clauses['select'][] = $t_sort_due_date;
$t_sort_col = "$t_sort_due_date, $t_sort_col";
}

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

0 comments on commit fa52c99

Please sign in to comment.