]> git.mxchange.org Git - friendica.git/commitdiff
Avoid notices whwn creating events
authorMichael <heluecht@pirati.ca>
Sun, 11 Apr 2021 06:53:01 +0000 (06:53 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 11 Apr 2021 06:53:01 +0000 (06:53 +0000)
mod/events.php
src/Model/Event.php

index 1feab61d5baeb2c32a1515ac8587e4f53d2ce4ef..85976f8f878a2130f60506e22b2d90c02cd3b1b3 100644 (file)
@@ -489,7 +489,7 @@ function events_content(App $a)
                $fdt = $orig_event['finish'] ?? 'now';
 
                $tz = date_default_timezone_get();
-               if (!empty($orig_event)) {
+               if (isset($orig_event['adjust'])) {
                        $tz = ($orig_event['adjust'] ? date_default_timezone_get() : 'UTC');
                }
 
index d2bc6ab86a7e6760ac14202c1be6a9111ebd1564..c59baba9cb9d7a4329f9ba5c59c5c92138950d81 100644 (file)
@@ -293,11 +293,10 @@ class Event
                }
                $private = intval($arr['private'] ?? 0);
 
-               $conditions = ['uid' => $event['uid']];
                if ($event['cid']) {
-                       $conditions['id'] = $event['cid'];
+                       $conditions = ['id' => $event['cid']];
                } else {
-                       $conditions['self'] = true;
+                       $conditions = ['uid' => $event['uid'], 'self' => true];
                }
 
                $contact = DBA::selectFirst('contact', [], $conditions);