aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/calendar
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-01-03 18:55:42 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2024-01-03 18:55:42 +0000
commit97994ba76c4c806b3bf410dc1ddff7777a2c1d33 (patch)
tree04459b800f976fdfdfaa79d7b2f3f8c4f2515697 /lib/classes/calendar
parent1e7019538a8ee3985bfc0a19960dca9737688a26 (diff)
fixes #3206
Closes #3206 Merge request studip/studip!2173
Diffstat (limited to 'lib/classes/calendar')
-rw-r--r--lib/classes/calendar/CalendarScheduleModel.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/classes/calendar/CalendarScheduleModel.php b/lib/classes/calendar/CalendarScheduleModel.php
index ce404b2..4b8a63a 100644
--- a/lib/classes/calendar/CalendarScheduleModel.php
+++ b/lib/classes/calendar/CalendarScheduleModel.php
@@ -31,14 +31,14 @@ class CalendarScheduleModel
*/
static function storeEntry($data)
{
- if ($data['id']) { // update
+ if (!empty($data['id'])) { // update
$stmt = DBManager::get()->prepare("UPDATE schedule
SET start = ?, end = ?, day = ?, title = ?, content = ?, color = ?, user_id = ?
WHERE id = ?");
$stmt->execute([$data['start'], $data['end'], $data['day'], $data['title'],
$data['content'], $data['color'], $data['user_id'], $data['id']]);
- NotificationCenter::postNotification('ScheduleDidUpdate', $GLOBALS['user']->id, ['values' => $data]);
+ NotificationCenter::postNotification('ScheduleDidUpdate', $GLOBALS['user']->id ?? null, ['values' => $data]);
} else {
$stmt = DBManager::get()->prepare("INSERT INTO schedule
@@ -46,7 +46,7 @@ class CalendarScheduleModel
VALUES (?, ?, ?, ?, ?, ?, ?)");
$stmt->execute([$data['start'], $data['end'], $data['day'], $data['title'],
$data['content'], $data['color'], $data['user_id']]);
- NotificationCenter::postNotification('ScheduleDidCreate', $GLOBALS['user']->id, ['values' => $data]);
+ NotificationCenter::postNotification('ScheduleDidCreate', $GLOBALS['user']->id ?? null, ['values' => $data]);
}
}