Skip to content

Commit

Permalink
Fix \yii\data\BaseDataProvider::setPagination()
Browse files Browse the repository at this point in the history
  • Loading branch information
lav45 committed Nov 17, 2023
1 parent d17a212 commit 7fa103c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions framework/data/BaseDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ public function setTotalCount($value)
public function getPagination()
{
if ($this->_pagination === null) {
$this->setPagination([
'totalCount' => $this->getTotalCount()
]);
$this->setPagination([]);
}
return $this->_pagination;
}
Expand All @@ -212,7 +210,10 @@ public function getPagination()
public function setPagination($value)
{
if (is_array($value)) {
$config = ['class' => Pagination::className()];
$config = [
'class' => Pagination::className(),
'totalCount' => $this->getTotalCount(),
];
if ($this->id !== null) {
$config['pageParam'] = $this->id . '-page';
$config['pageSizeParam'] = $this->id . '-per-page';
Expand Down

0 comments on commit 7fa103c

Please sign in to comment.