octicon-rss(16/)
You've already forked yii2
mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 23:50:38 +08:00
Fix #17961: Fix pagination pageSizeLimit ignore if set as array with more then 2 elements
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
committed by
GitHub
gitea-unlock(16/)
parent
088fd518fe
commit
2d15c484ef
octicon-diff(16/tw-mr-1) 2 changed files with 3 additions and 2 deletions
@@ -4,6 +4,7 @@ Yii Framework 2 Change Log
|
|||||||
2.0.35 under development
|
2.0.35 under development
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
- Bug #17961: Fix pagination `pageSizeLimit` ignore if set as array with more then 2 elements (tsvetiligo)
|
||||||
- Bug #18011: Added attribute labels support for `DynamicModel`, fixed `EachValidator` to pass the attribute label to the underlying `DynamicModel` (storch)
|
- Bug #18011: Added attribute labels support for `DynamicModel`, fixed `EachValidator` to pass the attribute label to the underlying `DynamicModel` (storch)
|
||||||
- Enh #18019: Allow jQuery 3.5.0 to be installed (wouter90)
|
- Enh #18019: Allow jQuery 3.5.0 to be installed (wouter90)
|
||||||
- Bug #17653: Fix `TypeError: pair[1] is undefined` when query param doesn't have = sign (baso10)
|
- Bug #17653: Fix `TypeError: pair[1] is undefined` when query param doesn't have = sign (baso10)
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ class Pagination extends BaseObject implements Linkable
|
|||||||
public function getPageSize()
|
public function getPageSize()
|
||||||
{
|
{
|
||||||
if ($this->_pageSize === null) {
|
if ($this->_pageSize === null) {
|
||||||
if (empty($this->pageSizeLimit)) {
|
if (empty($this->pageSizeLimit) || !isset($this->pageSizeLimit[0], $this->pageSizeLimit[1])) {
|
||||||
$pageSize = $this->defaultPageSize;
|
$pageSize = $this->defaultPageSize;
|
||||||
$this->setPageSize($pageSize);
|
$this->setPageSize($pageSize);
|
||||||
} else {
|
} else {
|
||||||
@@ -235,7 +235,7 @@ class Pagination extends BaseObject implements Linkable
|
|||||||
$this->_pageSize = null;
|
$this->_pageSize = null;
|
||||||
} else {
|
} else {
|
||||||
$value = (int) $value;
|
$value = (int) $value;
|
||||||
if ($validatePageSize && isset($this->pageSizeLimit[0], $this->pageSizeLimit[1]) && count($this->pageSizeLimit) === 2) {
|
if ($validatePageSize && isset($this->pageSizeLimit[0], $this->pageSizeLimit[1])) {
|
||||||
if ($value < $this->pageSizeLimit[0]) {
|
if ($value < $this->pageSizeLimit[0]) {
|
||||||
$value = $this->pageSizeLimit[0];
|
$value = $this->pageSizeLimit[0];
|
||||||
} elseif ($value > $this->pageSizeLimit[1]) {
|
} elseif ($value > $this->pageSizeLimit[1]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user