From 995867f17f65f83b666cbcde5b274efe83f50086 Mon Sep 17 00:00:00 2001 From: iszmais Date: Mon, 12 Jan 2026 15:08:41 +0100 Subject: [PATCH] Remove empty properties from groups and courses --- .../classes/class.ilObjCourseListGUI.php | 10 ++--- .../Group/classes/class.ilObjGroupAccess.php | 12 ++---- .../Group/classes/class.ilObjGroupListGUI.php | 42 ++++++++----------- .../Object/classes/class.ilObjectListGUI.php | 1 + 4 files changed, 26 insertions(+), 39 deletions(-) diff --git a/Modules/Course/classes/class.ilObjCourseListGUI.php b/Modules/Course/classes/class.ilObjCourseListGUI.php index 3f10d2802005..60a57396a3b9 100644 --- a/Modules/Course/classes/class.ilObjCourseListGUI.php +++ b/Modules/Course/classes/class.ilObjCourseListGUI.php @@ -1,7 +1,5 @@ @@ -143,12 +143,12 @@ public function getProperties(): array // course period $info = ilObjCourseAccess::lookupPeriodInfo($this->obj_id); - if (is_array($info)) { + if ($info !== []) { $props[] = array( 'alert' => false, 'newline' => true, - 'property' => $info['property'] ?? "", - 'value' => $info['value'] ?? "" + 'property' => $info['property'], + 'value' => $info['value'] ); } diff --git a/Modules/Group/classes/class.ilObjGroupAccess.php b/Modules/Group/classes/class.ilObjGroupAccess.php index 852f445e5f47..afeb9788f42e 100644 --- a/Modules/Group/classes/class.ilObjGroupAccess.php +++ b/Modules/Group/classes/class.ilObjGroupAccess.php @@ -1,7 +1,5 @@ | null - * @throws ilDateTimeException - */ - public static function lookupPeriodInfo(int $a_obj_id): ?array + public static function lookupPeriodInfo(int $a_obj_id): array { global $DIC; @@ -325,7 +319,7 @@ public static function lookupPeriodInfo(int $a_obj_id): ?array 'value' => ilDatePresentation::formatPeriod($start, $end) ]; } - return null; + return []; } public static function _usingRegistrationCode(): bool diff --git a/Modules/Group/classes/class.ilObjGroupListGUI.php b/Modules/Group/classes/class.ilObjGroupListGUI.php index 4a2dc5d9849c..97813bc821fc 100644 --- a/Modules/Group/classes/class.ilObjGroupListGUI.php +++ b/Modules/Group/classes/class.ilObjGroupListGUI.php @@ -1,29 +1,22 @@ obj_id); - if (is_array($info)) { + if ($info !== []) { $props[] = array( 'alert' => false, 'newline' => true, diff --git a/Services/Object/classes/class.ilObjectListGUI.php b/Services/Object/classes/class.ilObjectListGUI.php index 41487cb5ea8e..2322472d1f30 100644 --- a/Services/Object/classes/class.ilObjectListGUI.php +++ b/Services/Object/classes/class.ilObjectListGUI.php @@ -1284,6 +1284,7 @@ public function determineProperties(): array if (!$this->access->checkAccess('read', '', $this->ref_id, $this->type, $this->obj_id)) { $props[] = [ 'alert' => true, + 'property' => '', 'value' => $this->lng->txt('no_access_item_public'), 'newline' => true ];