Skip to content
Permalink
Browse files

Fix paginator defaulting for multi-default-sort.

  • Loading branch information...
dereuromark committed Nov 9, 2018
1 parent 21c8fce commit 756cf7e4a85a8719038b0a97dca6cc544a71494a
Showing with 2 additions and 1 deletion.
  1. +1 −1 src/Datasource/Paginator.php
  2. +1 −0 src/View/Helper/PaginatorHelper.php
@@ -221,7 +221,7 @@ public function paginate($object, array $params = [], array $settings = [])
'nextPage' => $count > ($page * $limit),
'pageCount' => $pageCount,
'sort' => $options['sort'],
'direction' => current($order),
'direction' => isset($options['sort']) ? current($order) : null,
'limit' => $defaults['limit'] != $limit ? $limit : null,
'sortDefault' => $sortDefault,
'directionDefault' => $directionDefault,
@@ -436,6 +436,7 @@ public function sort($key, $title = null, array $options = [])
$title = __(Inflector::humanize(preg_replace('/_id$/', '', $title)));
}
$defaultDir = isset($options['direction']) ? strtolower($options['direction']) : 'asc';
unset($options['direction']);

0 comments on commit 756cf7e

Please sign in to comment.
You can’t perform that action at this time.