Skip to content

Commit

Permalink
Dev: Fetch assessments for survey language
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Mar 5, 2018
1 parent 9bf9c76 commit fb864e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/models/Assessment.php
Expand Up @@ -151,6 +151,8 @@ public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.

$survey = Survey::model()->findByPk($this->sid);

$criteria = new CDbCriteria;

$criteria->compare('id', $this->id);
Expand All @@ -161,7 +163,7 @@ public function search()
$criteria->compare('minimum', $this->minimum);
$criteria->compare('maximum', $this->maximum);
$criteria->compare('message', $this->message, true);
$criteria->compare('language', App()->language);
$criteria->compare('language', $survey->language);

return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
Expand Down

0 comments on commit fb864e3

Please sign in to comment.