From b539161b2dd9974dc6461e466b3a5d3f8e6b52cd Mon Sep 17 00:00:00 2001 From: Lucas Ferreira Date: Fri, 26 May 2017 15:05:18 -0300 Subject: [PATCH] - Some fix into Paginator component for order / sort classic sintax --- lib/Cake/Controller/Component/PaginatorComponent.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Controller/Component/PaginatorComponent.php b/lib/Cake/Controller/Component/PaginatorComponent.php index 6e34fa6d7..85f8ab6b0 100644 --- a/lib/Cake/Controller/Component/PaginatorComponent.php +++ b/lib/Cake/Controller/Component/PaginatorComponent.php @@ -382,13 +382,13 @@ class PaginatorComponent extends Component { } return $options; } - if (!empty($options['order']) && is_array($options['order'])) { $order = array(); foreach ($options['order'] as $key => $value) { if (is_int($key)) { - $key = $value; - $value = 'asc'; + $field = explode(' ', $value); + $key = $field[0]; + $value = count($field) === 2 ? trim($field[1]) : 'asc'; } $field = $key; $alias = $object->alias;