Skip to content
Permalink
Browse files

enhancement to paginator

As pointed out, we need to make sure that we are also on the first page
to make this conditional clause valid
  • Loading branch information...
eagerterrier authored and markstory committed Apr 17, 2014
1 parent 296ea21 commit 823f01601d33d1048e792eaf5156bd0a9a59e5c9
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/Controller/Component/PaginatorComponent.php
@@ -202,8 +202,8 @@ public function paginate($object = null, $scope = array(), $whitelist = array())
$count = 0;
} elseif ($object->hasMethod('paginateCount')) {
$count = $object->paginateCount($conditions, $recursive, $extra);
} elseif (count($results)<$limit) {
$count = count($results); // no point in finding the count if it's less than our limit
} elseif (count($results) < $limit && $page==1) {
$count = count($results); // no point in finding the count if it's less than our limit and we're on the first page
} else {
$parameters = compact('conditions');
if ($recursive != $object->recursive) {

0 comments on commit 823f016

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