Skip to content

Commit

Permalink
Fixed they way we detect the direction in which we must sort the results
Browse files Browse the repository at this point in the history
(right now results were always sorted DESC regardless of the query)
  • Loading branch information
javiereguiluz committed Jan 17, 2015
1 parent d1194f9 commit 3d24f03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function initialize(Request $request)
if (!$request->query->has('sortField')) {
$request->query->set('sortField', 'id');
}
if (!$request->query->has('sortDirection') || !in_array(strtoupper($request->query->has('sortDirection')), array('ASC', 'DESC'))) {
if (!$request->query->has('sortDirection') || !in_array(strtoupper($request->query->get('sortDirection')), array('ASC', 'DESC'))) {
$request->query->set('sortDirection', 'DESC');
}

Expand Down

0 comments on commit 3d24f03

Please sign in to comment.