mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
avoid paginate count when no results
This commit is contained in:
parent
7008b812be
commit
88240b2874
1 changed files with 3 additions and 1 deletions
|
@ -197,7 +197,9 @@ class PaginatorComponent extends Component {
|
|||
$defaults = $this->getDefaults($object->alias);
|
||||
unset($defaults[0]);
|
||||
|
||||
if ($object->hasMethod('paginateCount')) {
|
||||
if (!$results) {
|
||||
$count = 0;
|
||||
} elseif ($object->hasMethod('paginateCount')) {
|
||||
$count = $object->paginateCount($conditions, $recursive, $extra);
|
||||
} else {
|
||||
$parameters = compact('conditions');
|
||||
|
|
Loading…
Add table
Reference in a new issue