mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 14:46:19 +08:00 
			
		
		
		
	Fix #17961: Fix pagination pageSizeLimit ignore if set as array with more then 2 elements
				
					
				
			This commit is contained in:
		@ -4,6 +4,7 @@ Yii Framework 2 Change Log
 | 
			
		||||
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)
 | 
			
		||||
- 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)
 | 
			
		||||
 | 
			
		||||
@ -213,7 +213,7 @@ class Pagination extends BaseObject implements Linkable
 | 
			
		||||
    public function getPageSize()
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->_pageSize === null) {
 | 
			
		||||
            if (empty($this->pageSizeLimit)) {
 | 
			
		||||
            if (empty($this->pageSizeLimit) || !isset($this->pageSizeLimit[0], $this->pageSizeLimit[1])) {
 | 
			
		||||
                $pageSize = $this->defaultPageSize;
 | 
			
		||||
                $this->setPageSize($pageSize);
 | 
			
		||||
            } else {
 | 
			
		||||
@ -235,7 +235,7 @@ class Pagination extends BaseObject implements Linkable
 | 
			
		||||
            $this->_pageSize = null;
 | 
			
		||||
        } else {
 | 
			
		||||
            $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]) {
 | 
			
		||||
                    $value = $this->pageSizeLimit[0];
 | 
			
		||||
                } elseif ($value > $this->pageSizeLimit[1]) {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user