Skip to content

Commit

Permalink
* FIX: the query introduced by commit 93d30e4
Browse files Browse the repository at this point in the history
the query won't work if the database used is postgres due to
type mistmacth in the where condition: lime_question_attributes.value=1

Since lime_question_attributes.value is of type "text" it needs to
be compared against strings rather then numbers.

The error reported by postgres is:

ERROR:  operator does not exist: text = integer at character 238
No operator matches the given name and argument type(s). You might
need to add explicit type casts.
  • Loading branch information
sickpig committed Jun 14, 2016
1 parent 2d3ff52 commit 2677cf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion application/helpers/frontend_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ function buildsurveysession($surveyid,$preview=false)
." JOIN {{question_attributes}} ON {{question_attributes}}.qid = {{questions}}.qid"
." WHERE {{questions}}.sid=".$surveyid."\n"
." AND {{question_attributes}}.attribute='hidden'"
." AND {{question_attributes}}.value=1"
." AND {{question_attributes}}.value='1'"
." AND {{questions}}.language='".App()->getLanguage()."'\n"
." AND {{questions}}.parent_qid=0\n";
$totalHiddenQuestions = Yii::app()->db->createCommand($sQuery)->queryScalar();
Expand Down

0 comments on commit 2677cf5

Please sign in to comment.