From 254974826f0fd139d74ed4fe18304dd7cad6213c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 17 Mar 2018 10:05:17 -0400 Subject: [PATCH] Fix wrong contact retrieval condition in Event::store --- src/Model/Event.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Model/Event.php b/src/Model/Event.php index 2626f64496..978dce7cf6 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -255,12 +255,14 @@ class Event extends BaseObject } $private = intval(defaults($arr, 'private', 0)); - $condition = ['uid' => $event['uid']]; + $conditions = ['uid' => $event['uid']]; if ($event['cid']) { - $condition['id'] = $event['cid']; + $conditions['id'] = $event['cid']; + } else { + $conditions['self'] = true; } - $contact = dba::selectFirst('contact', [], ['id' => $event['cid'], 'uid' => $event['uid']]); + $contact = dba::selectFirst('contact', [], $conditions); // Existing event being modified. if ($event['id']) { -- 2.39.5