Skip to content

Commit

Permalink
Allow columns that have value of 0 to be present
Browse files Browse the repository at this point in the history
Since array filter considers 0= false, and '0' = false, if you have a column with values 0 and 1, you can't sort that column, as it will be filtered out.
using the strlen filter, you ensure that values like null,empty and false are removed, but you keep values that would be boolean false in php, but they shouldn't.
  • Loading branch information
ecodrutz authored Mar 14, 2017
1 parent 1707f8f commit 017d3ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ColumnSortable/SortableLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function render(array $parameters)
$queryString = http_build_query(
array_merge(
$queryParameters,
array_filter(Request::except('sort', 'order', 'page')),
array_filter(Request::except('sort', 'order', 'page'), 'strlen'),
[
'sort' => $sortParameter,
'order' => $direction,
Expand Down

0 comments on commit 017d3ff

Please sign in to comment.