From 0dfa6387519755371359e36cae55526f43217f2d Mon Sep 17 00:00:00 2001
From: Moritz Strohm <strohm@data-quest.de>
Date: Thu, 21 Mar 2024 15:17:56 +0000
Subject: [PATCH] default to current user calendar if no calendar is selected,
 fixes #3874

Closes #3874

Merge request studip/studip!2725
---
 app/controllers/calendar/calendar.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/controllers/calendar/calendar.php b/app/controllers/calendar/calendar.php
index 33c41137534..6ae77ebb085 100644
--- a/app/controllers/calendar/calendar.php
+++ b/app/controllers/calendar/calendar.php
@@ -141,6 +141,10 @@ class Calendar_CalendarController extends AuthenticatedController
             } elseif ($user_id) {
                 $calendar_owner = User::getCalendarOwner($user_id);
                 $view = 'single';
+            } else {
+                //Show the calendar of the current user.
+                $view = 'single';
+                $calendar_owner = User::findCurrent();
             }
         } else {
             //Show the calendar of the current user.
-- 
GitLab