From 3a09ef88add343ef610544b63fb0b692661825a7 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Thu, 25 Apr 2024 12:27:26 +0200 Subject: [PATCH] Course: fix init of course objective entries in list on sorting tab (39351) --- .../ObjectiveView/class.ObjectiveRenderer.php | 2 +- .../Objectives/class.ilCourseObjectiveListGUI.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php b/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php index 91338a3f3a73..5fba04a0b686 100755 --- a/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php +++ b/components/ILIAS/Container/Content/ObjectiveView/class.ObjectiveRenderer.php @@ -173,7 +173,7 @@ public function showObjectives(bool $a_is_order = false): void $acc->setBehaviour(\ilAccordionGUI::FIRST_OPEN); $acc->setId("crsobjtv_" . $this->container->getId()); } else { - // $this->renderer->addCustomBlock('lobj', $lng->txt('crs_objectives')); + $this->renderer->addCustomBlock('lobj', $lng->txt('crs_objectives')); } $lur_data = $this->parseLOUserResults(); diff --git a/components/ILIAS/Course/classes/Objectives/class.ilCourseObjectiveListGUI.php b/components/ILIAS/Course/classes/Objectives/class.ilCourseObjectiveListGUI.php index df16240da714..6f5aa68af394 100755 --- a/components/ILIAS/Course/classes/Objectives/class.ilCourseObjectiveListGUI.php +++ b/components/ILIAS/Course/classes/Objectives/class.ilCourseObjectiveListGUI.php @@ -56,7 +56,19 @@ public function getObjectiveListItemHTML( true, "components/ILIAS/Container" ); - $this->initItem($a_ref_id, $a_obj_id, ilObject::_lookupType($a_obj_id), $a_title, $a_description); + + /* + * Previously, ilObjectListGUI::initItem was called here, but changes were made + * to that method with the assumption that only repository objects would be referenced, + * breaking it here for objectives. + * Currently, we have to initialize what we need manually, and cross + * our fingers that no changes are made to e.g. ilObjectListGUI::insertDescription + * or ilObjectListGUI::insertIconsAndCheckboxes that break things again. + */ + $this->ref_id = $a_ref_id; + $this->obj_id = $a_obj_id; + $this->setTitle($a_title); + $this->setDescription($a_description); $this->insertIconsAndCheckboxes(); $this->insertTitle();