Skip to content

Commit

Permalink
Fixed issue #11353: Unable to movbe to next page on survey list
Browse files Browse the repository at this point in the history
Fixed issue #11283: pagination in Questions in this survey causes a SQL error (MSSQL)
  • Loading branch information
LouisGac committed Jun 9, 2016
1 parent 24c8f4f commit 5bd6ba3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions application/models/Question.php
Expand Up @@ -891,7 +891,8 @@ public function search()
'desc'=>'groups.group_name desc',
),
);
$sort->defaultOrder = array('t.question_order' => CSort::SORT_ASC, 'groups.group_order' => CSort::SORT_ASC);
//$sort->defaultOrder = array('t.question_order' => CSort::SORT_ASC, 'groups.group_order' => CSort::SORT_ASC);
$sort->defaultOrder = array('question_order' => CSort::SORT_ASC );

$criteria = new CDbCriteria;
$criteria->with=array('groups');
Expand All @@ -907,13 +908,14 @@ public function search()
$qid_reference = (Yii::app()->db->getDriverName() == 'pgsql' ?' t.qid::varchar' : 't.qid');
$criteria2->compare($qid_reference, $this->title, true, 'OR');

$criteria->mergeWith($criteria2, 'AND');

if($this->group_name != '')
{
$criteria->compare('groups.group_name', $this->group_name, true, 'AND');
}

$criteria->mergeWith($criteria2, 'AND');

$dataProvider=new CActiveDataProvider('Question', array(
'criteria'=>$criteria,
'sort'=>$sort,
Expand Down
2 changes: 1 addition & 1 deletion application/models/Survey.php
Expand Up @@ -941,7 +941,7 @@ public function search()
),

);
$sort->defaultOrder = array('t.datecreated' => CSort::SORT_DESC);
$sort->defaultOrder = array('creation_date' => CSort::SORT_DESC);

$criteria = new CDbCriteria;
$aWithRelations = array('correct_relation_defaultlanguage');
Expand Down

0 comments on commit 5bd6ba3

Please sign in to comment.