From 5b2c4d70be704cad6e52518c8a3679887541c48b Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 11 Apr 2021 06:53:01 +0000 Subject: [PATCH] Avoid notices whwn creating events --- mod/events.php | 2 +- src/Model/Event.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mod/events.php b/mod/events.php index 1feab61d5b..85976f8f87 100644 --- a/mod/events.php +++ b/mod/events.php @@ -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'); } diff --git a/src/Model/Event.php b/src/Model/Event.php index d2bc6ab86a..c59baba9cb 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -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);