Skip to content

Commit

Permalink
(Fixes issue 2438) Fixed the bug that CPagination will ignore $_GET w…
Browse files Browse the repository at this point in the history
…hen CPagination::params is used
  • Loading branch information
alexander.makarow committed May 28, 2011
1 parent eb49b8b commit a3b2e98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Version 1.1.8 work in progress
- Bug #2409: Fixed the bug that CCaptcha::buttonOptions is not respected (Qiang)
- Bug #2411: Fixed the bug that CCaptcha will fail when setting buttonType to be 'button' (Qiang)
- Bug #2422: Fixed the bug that calling CLogger::flush(true) multiple times may cause duplication of dumped messages (Qiang)
- Bug #2438: Fixed the bug that CPagination will ignore $_GET when CPagination::params is used (Sam Dark)
- Bug #2475: Fixed the bug that CMssqlCommandBuilder and COciCommandBuilder don't respect parameters declared in CDbExpression when doing insertion and updating (Qiang)
- Bug #2485: Fixed the bug that CMssqlPdoAdapter is not used when the driver is sqlsrv (Qiang)
- Bug: CMapIterator current key wasn't initialized properly (Sam Dark, Detonator)
Expand Down
6 changes: 3 additions & 3 deletions framework/web/CPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function setCurrentPage($value)
*/
public function createPageUrl($controller,$page)
{
$params=$this->params===null ? $_GET : $this->params;
$params=$this->params===null ? $_GET : array_merge($_GET, $this->params);
if($page>0) // page 0 is the default
$params[$this->pageVar]=$page+1;
else
Expand All @@ -218,7 +218,7 @@ public function applyLimit($criteria)
*/
public function getOffset()
{
return $this->currentPage*$this->pageSize;
return $this->getCurrentPage()*$this->getPageSize();
}

/**
Expand All @@ -229,6 +229,6 @@ public function getOffset()
*/
public function getLimit()
{
return $this->pageSize;
return $this->getPageSize();
}
}

0 comments on commit a3b2e98

Please sign in to comment.