From c680176306b18a13b3a3acd69f6c5e84c9d4ea11 Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Wed, 10 Apr 2024 09:03:47 +0000
Subject: [PATCH] fixes #3983

Closes #3983

Merge request studip/studip!2835
---
 lib/models/calendar/CalendarDate.class.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/models/calendar/CalendarDate.class.php b/lib/models/calendar/CalendarDate.class.php
index e9269c61bbd..7026ece1d8a 100644
--- a/lib/models/calendar/CalendarDate.class.php
+++ b/lib/models/calendar/CalendarDate.class.php
@@ -402,8 +402,8 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
         $sorm = self::findThru($storage->user_id, [
             'thru_table'        => 'calendar_date_assignments',
             'thru_key'          => 'range_id',
-            'thru_assoc_key'    => 'event_id',
-            'assoc_foreign_key' => 'event_id',
+            'thru_assoc_key'    => 'calendar_date_id',
+            'assoc_foreign_key' => 'id',
         ]);
         if ($sorm) {
             $field_data = [];
-- 
GitLab