Skip to content

Commit

Permalink
Fixed issue #17968: conditions designer does not show the right quest…
Browse files Browse the repository at this point in the history
…ions to select (#2332)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed Apr 7, 2022
1 parent 2bfe1a2 commit 0726f1f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions application/controllers/admin/ConditionsAction.php
Expand Up @@ -1309,19 +1309,14 @@ protected function getSurveyIsAnonymized()
*/
protected function getQuestionRows()
{
$qresult = Question::model()->findAllByAttributes(array(
'parent_qid' => 0,
'sid' => $this->iSurveyID));
$qresult = Question::model()->primary()->getQuestionList($this->iSurveyID);

//'language' => $this->language
$qrows = array();
foreach ($qresult as $k => $v) {
$qrows[$k] = array_merge($v->attributes, $v->group->attributes);
}

// Perform a case insensitive natural sort on group name then question title (known as "code" in the form) of a multidimensional array
usort($qrows, 'groupOrderThenQuestionOrder');

return $qrows;
}

Expand Down
1 change: 0 additions & 1 deletion application/helpers/common_helper.php
Expand Up @@ -838,7 +838,6 @@ function templateDefaultTexts($sLanguage, $mode = 'html', $sNewlines = 'text')
* and returns -1, 0 or 1 depending on the result of the comparison of
* the sort order of the group_order and question_order field
* Used by :
* - conditionsaction->getQuestionRows with merging group and question attributes (all in same array)
* - remotecontrol_handle->export_statistics with merging group and question attributes (all in same array)
* - checkQuestions() in activate_helper function with ?
* @param mixed $a
Expand Down

0 comments on commit 0726f1f

Please sign in to comment.