]> git.mxchange.org Git - friendica.git/commitdiff
Fix wrong contact retrieval condition in Event::store
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 17 Mar 2018 14:05:17 +0000 (10:05 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Fri, 23 Mar 2018 10:34:21 +0000 (06:34 -0400)
src/Model/Event.php

index 2626f64496dd136ef0b291abd4085e0e1be97e09..978dce7cf67758ec83b4cebc42bcc0407bfb17bf 100644 (file)
@@ -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']) {