Skip to content

Commit

Permalink
Fixed issue #8797: Error 500 when searching for Attribute Field conte…
Browse files Browse the repository at this point in the history
…nt in CPDB
  • Loading branch information
c-schmitz committed Mar 17, 2014
1 parent 2542670 commit d6f9896
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion application/models/Participant.php
Expand Up @@ -279,7 +279,15 @@ private function getParticipantsSelectCommand($count = false, $attid, $search =
$selectValue[] = "luser.full_name as ownername";
$selectValue[] = "luser.users_name as username";


$aAllAttributes = ParticipantAttributeName::model()->getAllAttributes();
foreach ($aAllAttributes as $aAttribute)
{
if(strpos($search->condition,'attribute'.$aAttribute['attribute_id'])!==false)
{
$attid[]=$aAttribute;
}
}
$attid=array_unique($attid);
// Add survey count subquery
$subQuery = Yii::app()->db->createCommand()
->select('count(*) survey')
Expand Down Expand Up @@ -836,6 +844,7 @@ function getParticipantsSearchMultipleCondition($condition)
elseif (is_numeric($sFieldname)) //Searching for an attribute
{
$command->addCondition('attribute'. $sFieldname . '.value ' . $operator . ' '.$param, $booloperator);
// $command->addCondition('(attribute_id='. $sFieldname . ' AND value ' . $operator . ' '.$param.' )', $booloperator);
}
else
{
Expand Down

0 comments on commit d6f9896

Please sign in to comment.