From 83ff1dad204067b5390ece87a2f9b8a7b6427b39 Mon Sep 17 00:00:00 2001 From: Jan-Hendrik Willms <tleilax+studip@gmail.com> Date: Mon, 27 Jun 2022 10:56:21 +0000 Subject: [PATCH] set booking user to current user if resource booking is changed or if the user is invalid, fixes #1220 Closes #1220 Merge request studip/studip!729 --- lib/models/resources/ResourceBooking.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/models/resources/ResourceBooking.class.php b/lib/models/resources/ResourceBooking.class.php index 548f86d52bc..58c8ecb09c3 100644 --- a/lib/models/resources/ResourceBooking.class.php +++ b/lib/models/resources/ResourceBooking.class.php @@ -465,8 +465,10 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen } // update the booking user - $this->booking_user = User::findCurrent(); - + if (!$this->isNew() || !$this->booking_user_id) { + $this->booking_user = User::findCurrent(); + } + //Check if the user has booking rights on the resource. //The user must have either permanent permissions or they have to //have booking rights by a temporary permission in this moment -- GitLab