Skip to content

Commit

Permalink
Fixed ordering in ArrayDataProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
pfilsx committed Apr 19, 2019
1 parent 36630aa commit 2003903
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Grid/Providers/ArrayDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ protected function buildCompare($attribute, $order)
return 0;
}
if ($type1 == 'string') {
return strcmp($attrValueA, $attrValueB);
return $order == 'ASC' ? strcmp($attrValueA, $attrValueB) : -strcmp($attrValueA, $attrValueB);
}
return $attrValueA < $attrValueB ? -1 : 1;
return $attrValueA < $attrValueB ? ($order == 'ASC' ? -1 : 1) : ($order == 'ASC' ? 1 : -1);
};
}

Expand Down

0 comments on commit 2003903

Please sign in to comment.