From f9ffe0c36bb48d587a88933035cb40518b221781 Mon Sep 17 00:00:00 2001 From: adisposkofh Date: Thu, 9 Jul 2026 09:23:28 +0200 Subject: [PATCH] minor mod to how moodle events are excluded from other lv plan --- application/controllers/api/frontend/v1/LvPlan.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/application/controllers/api/frontend/v1/LvPlan.php b/application/controllers/api/frontend/v1/LvPlan.php index 2a900e92d..7a2a522ff 100644 --- a/application/controllers/api/frontend/v1/LvPlan.php +++ b/application/controllers/api/frontend/v1/LvPlan.php @@ -108,8 +108,10 @@ class LvPlan extends FHCAPI_Controller $result = $this->stundenplanlib->getEventsUser($start_date, $end_date, $uid); $lvplanEvents = $this->getDataOrTerminateWithError($result); - // fetching moodle events - $moodleEvents = $this->fetchMoodleEvents($start_date, $end_date, $uid); + if ($uid && $uid !== getAuthUID()) { + // fetching moodle events + $moodleEvents = $this->fetchMoodleEvents($start_date, $end_date, $uid); + } // fetching ferien events $ferienEvents = $this->fetchFerienEvents($start_date, $end_date, $uid); @@ -418,10 +420,6 @@ class LvPlan extends FHCAPI_Controller */ private function fetchMoodleEvents($start_date, $end_date, $uid = null) { - if ($uid && $uid !== getAuthUID()) { - return []; - } - $this->load->config('calendar'); $tz = new DateTimeZone($this->config->item('timezone'));