From 05a4b5a705edc368afae7ae4e22b89293f1b9814 Mon Sep 17 00:00:00 2001 From: mstuder Date: Sun, 14 Apr 2019 12:07:57 +0200 Subject: [PATCH] fix ilias 5.4 - bug do not remove course from deskopt --- src/UserSetting/UserSetting.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/UserSetting/UserSetting.php b/src/UserSetting/UserSetting.php index 56ba31e..dc1b620 100644 --- a/src/UserSetting/UserSetting.php +++ b/src/UserSetting/UserSetting.php @@ -258,16 +258,18 @@ protected function assignCourses() { continue; } $crs = new ilObjCourse($crs_obj_id,false); - $part = ilCourseParticipants::_getInstanceByObjId($crs_obj_id); + + $part =new ilCourseParticipants($crs_obj_id); + $usr_id = $this->getUsrObject()->getId(); $added = $part->add($usr_id, ilCourseConstants::CRS_MEMBER); $crs->checkLPStatusSync($usr_id); if (!in_array($crs_obj_id, $this->getAssignedCoursesDesktop()) && $added) { - $all_refs = ilObject2::_getAllReferences($crs_obj_id); - $first = array_shift(array_values($all_refs)); - ilObjUser::_dropDesktopItem($usr_id, $first, Courses::TYPE_CRS); + // $all_refs = ilObject2::_getAllReferences($crs_obj_id); + // $first = array_shift(array_values($all_refs)); + // ilObjUser::_dropDesktopItem($usr_id, $first, Courses::TYPE_CRS); } } }