Skip to content

Commit

Permalink
Fix Gridview or Listview 'maxButtonCount' attribute is not working wh…
Browse files Browse the repository at this point in the history
…en it's assign with 2 #19655
  • Loading branch information
msobin committed Jul 20, 2023
1 parent 76d6345 commit 10bed5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Yii Framework 2 Change Log
- Enh #19853: Added support for default value for `\yii\helpers\Console::select()` (rhertogh)
- Bug #19868: Added whitespace sanitation for tests, due to updates in ICU 72 (schmunk42)
- Enh #19884: Added support Enums in Query Builder (sk1t0n)
- Bug #19655: Fix Gridview or Listview 'maxButtonCount' attribute is not working when it's assign with 2


2.0.48.1 May 24, 2023
Expand Down
2 changes: 1 addition & 1 deletion framework/widgets/LinkPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected function getPageRange()
$currentPage = $this->pagination->getPage();
$pageCount = $this->pagination->getPageCount();

$beginPage = max(0, $currentPage - (int) ($this->maxButtonCount / 2));
$beginPage = max(0, $currentPage - (int) (($this->maxButtonCount - 1) / 2));
if (($endPage = $beginPage + $this->maxButtonCount - 1) >= $pageCount) {
$endPage = $pageCount - 1;
$beginPage = max(0, $endPage - $this->maxButtonCount + 1);
Expand Down

0 comments on commit 10bed5c

Please sign in to comment.