From a1828b1016e78c0c261dd7a50d5d4f125e56d71f Mon Sep 17 00:00:00 2001 From: Olle Haerstedt Date: Thu, 22 Sep 2016 12:14:21 +0200 Subject: [PATCH] Dev: Add extra condition to share search (CPDB) --- application/models/ParticipantShare.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/models/ParticipantShare.php b/application/models/ParticipantShare.php index 5b248e2e0d6..60308a40285 100644 --- a/application/models/ParticipantShare.php +++ b/application/models/ParticipantShare.php @@ -224,7 +224,10 @@ public function search() $criteria=new CDbCriteria; $criteria->with = array('participant','shared_by'); - $criteria->compare('participant_id',$this->participant_id, false); + + // This condition is necessary to filter out participants that got deleted, but the share entry is not + $criteria->addCondition('participant.participant_id = t.participant_id'); + $criteria->compare('share_uid',$this->share_uid); $criteria->compare('date_added',$this->date_added,true); $criteria->compare('can_edit',$this->can_edit,true);