diff --git a/components/ILIAS/BookingManager/BookingService/class.ilBookingGatewayGUI.php b/components/ILIAS/BookingManager/BookingService/class.ilBookingGatewayGUI.php index c6ad0f1f3255..ee95ae9ed325 100755 --- a/components/ILIAS/BookingManager/BookingService/class.ilBookingGatewayGUI.php +++ b/components/ILIAS/BookingManager/BookingService/class.ilBookingGatewayGUI.php @@ -174,7 +174,11 @@ public function executeCommand(): void case "ilbookingreservationsgui": $this->showPoolSelector("ilbookingreservationsgui"); $this->setSubTabs("reservations"); - $res_gui = new ilBookingReservationsGUI($this->pool, $this->help, $this->obj_id); + $res_gui = new ilBookingReservationsGUI( + $this->pool, + $this->help, + ilObject::_lookupType($this->obj_id) !== 'crs' ? $this->obj_id : null + ); $this->ctrl->forwardCommand($res_gui); break; diff --git a/components/ILIAS/BookingManager/Reservations/class.ilBookingReservationsGUI.php b/components/ILIAS/BookingManager/Reservations/class.ilBookingReservationsGUI.php index e994a4656545..fb0f466c2ed4 100755 --- a/components/ILIAS/BookingManager/Reservations/class.ilBookingReservationsGUI.php +++ b/components/ILIAS/BookingManager/Reservations/class.ilBookingReservationsGUI.php @@ -30,7 +30,7 @@ class ilBookingReservationsGUI protected array $raw_post_data; protected \ILIAS\BookingManager\StandardGUIRequest $book_request; protected ilBookingHelpAdapter $help; - protected int $context_obj_id; + protected ?int $context_obj_id; protected ilCtrl $ctrl; protected ilGlobalTemplateInterface $tpl; protected ilLanguage $lng; @@ -43,11 +43,8 @@ class ilBookingReservationsGUI protected string $reservation_id; // see BookingReservationDBRepo, obj_user_(slot)_context protected int $booked_user; - public function __construct( - ilObjBookingPool $pool, - ilBookingHelpAdapter $help, - int $context_obj_id = 0 - ) { + public function __construct(ilObjBookingPool $pool, ilBookingHelpAdapter $help, ?int $context_obj_id = null) + { global $DIC; $this->tpl = $DIC->ui()->mainTemplate(); @@ -161,7 +158,7 @@ protected function getReservationsTable(?string $reservation_id = null): ilBooki $show_all, $filter, $reservation_id, - $this->context_obj_id > 0 ? [$this->context_obj_id] : null + $this->context_obj_id !== null ? [$this->context_obj_id] : null ); }