mirror of
https://github.com/processwire/processwire.git
synced 2025-08-07 07:16:51 +02:00
Updated PaginatedArray::getTotal() method to return the count() quantity when no total has been set (previously it returned 0 if not set)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* #pw-body
|
||||
* #pw-summary-manipulation In most cases you will not need these manipulation methods as core API calls already take care of this.
|
||||
*
|
||||
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
|
||||
* ProcessWire 3.x, Copyright 2023 by Ryan Cramer
|
||||
* https://processwire.com
|
||||
*
|
||||
* @method string renderPager(array $options = array()) Renders pagination, when MarkupPageArray module installed
|
||||
@@ -79,7 +79,9 @@ class PaginatedArray extends WireArray implements WirePaginatable {
|
||||
*
|
||||
*/
|
||||
public function getTotal() {
|
||||
return $this->numTotal;
|
||||
$total = $this->numTotal;
|
||||
if(!$total) $total = $this->count();
|
||||
return $total;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -327,4 +329,4 @@ class PaginatedArray extends WireArray implements WirePaginatable {
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user