Skip to content

Commit

Permalink
Fixed issue #11450: Unable to browse response
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 15, 2016
1 parent 2f56bab commit f27eba3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/models/SurveyDynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function relations()
{
TokenDynamic::sid(self::$sid);
return array(
'survey' => array(self::HAS_ONE, 'Survey', array(), 'condition'=>('sid = '.self::$sid)),
'tokens' => array(self::HAS_ONE, 'TokenDynamic', array('token' => 'token'))
);
}
Expand Down Expand Up @@ -582,10 +583,9 @@ public function search()


// Join the token table and filter tokens if needed
if ($this->bHaveToken)
if ($this->bHaveToken && $this->survey->anonymized != 'Y')
{
$criteria->compare('t.token',$this->token, true);

$criteria->join = "LEFT JOIN {{tokens_" . self::$sid . "}} as tokens ON t.token = tokens.token";
$criteria->compare('tokens.firstname',$this->firstname_filter, true);
$criteria->compare('tokens.lastname',$this->lastname_filter, true);
Expand Down

0 comments on commit f27eba3

Please sign in to comment.