Adding fix for failing DboSource tests

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5126 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-05-20 05:20:18 +00:00
parent dcad548cac
commit 3a31e38937

View file

@ -1031,7 +1031,7 @@ class DboSource extends DataSource {
$limit = '';
if (isset($assocData['limit'])) {
if (!isset($assocData['offset']) && isset($assocData['page'])) {
if ((!isset($assocData['offset']) || (empty($assocData['offset']))) && isset($assocData['page'])) {
$assocData['offset'] = ($assocData['page'] - 1) * $assocData['limit'];
} elseif (!isset($assocData['offset'])) {
$assocData['offset'] = null;
@ -1115,7 +1115,6 @@ class DboSource extends DataSource {
$query = array(
'conditions' => $assocData['conditions'],
'limit' => $limit,
'offset' => $assocData['offset'],
'table' => $this->fullTableName($linkModel),
'alias' => $alias,
'fields' => am($this->fields($linkModel, $alias, $assocData['fields']), $joinFields),