diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 894b1ad2a5d..9b9ae6a8b31 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -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 diff --git a/framework/widgets/LinkPager.php b/framework/widgets/LinkPager.php index 9056981c31e..7ad850cb9cd 100644 --- a/framework/widgets/LinkPager.php +++ b/framework/widgets/LinkPager.php @@ -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);