Skip to content

Commit

Permalink
Fixed issue #6526: Incorrect behavior when using prev/next question a…
Browse files Browse the repository at this point in the history
…rrows for groups/questions
  • Loading branch information
c-schmitz committed Sep 14, 2012
1 parent 01a31b8 commit afd0c03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/helpers/common_helper.php
Expand Up @@ -641,7 +641,7 @@ function getGidPrevious($surveyid, $gid)

if (!$surveyid) {$surveyid=returnGlobal('sid');}
$s_lang = Survey::model()->findByPk($surveyid)->language;
$qresult = Groups::model()->findAllByAttributes(array('sid' => $surveyid, 'language' => $s_lang)); //checked
$qresult = Groups::model()->findAllByAttributes(array('sid' => $surveyid, 'language' => $s_lang), array('order'=>'group_order'));

$i = 0;
$iPrev = -1;
Expand Down Expand Up @@ -670,7 +670,7 @@ function getQidPrevious($surveyid, $gid, $qid)
{
$clang = Yii::app()->lang;
$s_lang = Survey::model()->findByPk($surveyid)->language;
$qrows = Questions::model()->findAllByAttributes(array('gid' => $gid, 'sid' => $surveyid, 'language' => $s_lang));
$qrows = Questions::model()->findAllByAttributes(array('gid' => $gid, 'sid' => $surveyid, 'language' => $s_lang, 'parent_qid'=>0),array('order'=>'question_order'));

$i = 0;
$iPrev = -1;
Expand Down Expand Up @@ -707,7 +707,7 @@ function getGidNext($surveyid, $gid)

//$gquery = "SELECT gid FROM ".db_table_name('groups')." WHERE sid=$surveyid AND language='{$s_lang}' ORDER BY group_order";

$qresult = Groups::model()->findAllByAttributes(array('sid' => $surveyid, 'language' => $s_lang)); //checked
$qresult = Groups::model()->findAllByAttributes(array('sid' => $surveyid, 'language' => $s_lang), array('order'=>'group_order'));

$GidNext="";
$i = 0;
Expand Down Expand Up @@ -739,7 +739,7 @@ function getQidNext($surveyid, $gid, $qid)
{
$clang = Yii::app()->lang;
$s_lang = Survey::model()->findByPk($surveyid)->language;
$qrows = Questions::model()->findAllByAttributes(array('gid' => $gid, 'sid' => $surveyid, 'language' => $s_lang, 'parent_qid' => 0));
$qrows = Questions::model()->findAllByAttributes(array('gid' => $gid, 'sid' => $surveyid, 'language' => $s_lang, 'parent_qid' => 0), array('order'=>'question_order'));


$i = 0;
Expand Down

0 comments on commit afd0c03

Please sign in to comment.