From edd2d02eb0933ed4e75d6b5d921cc29cf5a6b236 Mon Sep 17 00:00:00 2001 From: Maximilian Becker Date: Wed, 13 Dec 2023 07:23:49 +0100 Subject: [PATCH 1/6] Shortening table ID --- classes/GUI/class.ilTestListTableGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/GUI/class.ilTestListTableGUI.php b/classes/GUI/class.ilTestListTableGUI.php index ff5a3d1..a7a907e 100755 --- a/classes/GUI/class.ilTestListTableGUI.php +++ b/classes/GUI/class.ilTestListTableGUI.php @@ -52,7 +52,7 @@ public function __construct(ilObjectGUI $a_parent_obj, $a_parent_cmd) /* Pre-configure table */ $this->setId( sprintf( - 'test_overview_test_list_%d', + 'xtov_tst_lst_%d', $a_parent_obj->getObject()->getId() ) ); From 2ebb7448fabb2e56432fc39d8cad31b99e9ccee0 Mon Sep 17 00:00:00 2001 From: Maximilian Becker Date: Thu, 14 Dec 2023 14:47:46 +0100 Subject: [PATCH 2/6] Namesetting from db-row, casting --- classes/GUI/class.ilTestOverviewTableGUI.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/GUI/class.ilTestOverviewTableGUI.php b/classes/GUI/class.ilTestOverviewTableGUI.php index 8d41db2..a43b0d8 100755 --- a/classes/GUI/class.ilTestOverviewTableGUI.php +++ b/classes/GUI/class.ilTestOverviewTableGUI.php @@ -404,10 +404,10 @@ private function fetchUserInformation($usr_ids): array $user = new ilObjUser(); $user->setId((int)$row['usr_id']); - $user->setLogin($row['login']); - $user->setUTitle($row['title']); - $user->setFirstname($row['firstname']); - $user->setLastname($row['lastname']); + $user->setLogin((string) $row['login']); + $user->setUTitle((string) $row['title']); + $user->setFirstname((string) $row['firstname']); + $user->setLastname((string) $row['lastname']); $user->setFullname(); if (! empty($this->filter['flt_participant_name'])) { From c52be8e0d34fec2135187a0309dba8a1b50c21cd Mon Sep 17 00:00:00 2001 From: Maximilian Becker Date: Mon, 29 Jan 2024 09:23:04 +0100 Subject: [PATCH 3/6] Types & Links --- classes/GUI/class.ilTestOverviewTableGUI.php | 2 +- classes/class.ilObjTestOverviewGUI.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/GUI/class.ilTestOverviewTableGUI.php b/classes/GUI/class.ilTestOverviewTableGUI.php index a43b0d8..1864b96 100755 --- a/classes/GUI/class.ilTestOverviewTableGUI.php +++ b/classes/GUI/class.ilTestOverviewTableGUI.php @@ -844,7 +844,7 @@ protected function buildMemberResultLinkTarget($refId, $activeId): string global $ilCtrl; $link = $ilCtrl->getLinkTargetByClass( - array('ilObjTestOverviewGUI', 'ilobjtestgui', 'iltestevaluationgui'), + array('ilobjtestgui', 'iltestevaluationgui'), 'outParticipantsPassDetails' ); diff --git a/classes/class.ilObjTestOverviewGUI.php b/classes/class.ilObjTestOverviewGUI.php index f74fde1..2a0abd1 100755 --- a/classes/class.ilObjTestOverviewGUI.php +++ b/classes/class.ilObjTestOverviewGUI.php @@ -234,8 +234,8 @@ public function initSelectTests(): void public function initCourseTests(): void { $pnode = $this->tree->getParentNodeData((int) $this->request->getQueryParams()['ref_id']); - $otype = ilObject::_lookupType($pnode['ref_id'], true); // Parent node is 'crs' - $tsts = $this->tree->getFilteredSubTree($pnode['ref_id'], ['tst']); // and has 'tst's + $otype = ilObject::_lookupType((int) $pnode['ref_id'], true); // Parent node is 'crs' + $tsts = $this->tree->getFilteredSubTree((int) $pnode['ref_id'], ['tst']); // and has 'tst's $refs = []; foreach($tsts as $tst) { From f1317f2cc3e5ad57fa741472579b1e371faa74a1 Mon Sep 17 00:00:00 2001 From: Maximilian Becker Date: Tue, 30 Jan 2024 09:27:56 +0100 Subject: [PATCH 4/6] Type in Access Check --- classes/class.ilObjTestOverviewGUI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/class.ilObjTestOverviewGUI.php b/classes/class.ilObjTestOverviewGUI.php index 2a0abd1..10d74d7 100755 --- a/classes/class.ilObjTestOverviewGUI.php +++ b/classes/class.ilObjTestOverviewGUI.php @@ -244,7 +244,7 @@ public function initCourseTests(): void $num_nodes = 0; foreach($refs as $ref_id) { - if($this->access->checkAccess('tst_statistics', '', $ref_id) || $this->access->checkAccess('write', '', $ref_id)) { + if($this->access->checkAccess('tst_statistics', '', (int) $ref_id) || $this->access->checkAccess('write', '', (int) $ref_id)) { $this->object->addTest($ref_id); ++$num_nodes; } From 7011181a86c854b837750e11cb81bbeacc74ed32 Mon Sep 17 00:00:00 2001 From: Martin Gorgas Date: Tue, 12 Mar 2024 11:53:36 +0100 Subject: [PATCH 5/6] fixes 'Attempt to read property "true" on null' error --- classes/mapper/class.ilDataMapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/mapper/class.ilDataMapper.php b/classes/mapper/class.ilDataMapper.php index 55e9e5d..960f280 100755 --- a/classes/mapper/class.ilDataMapper.php +++ b/classes/mapper/class.ilDataMapper.php @@ -86,7 +86,7 @@ public function getValue(string $table, string $field, array $conditions = array $res = $this->db->query($query); $row = $this->db->fetchObject($res); - return $row->{strtolower($field)} || $row->{strtoupper($field)} ; + return $row !== null ? $row->{strtolower($field)} || $row->{strtoupper($field)} : null; } /** From fe9383aebe916cba7fd0662079e4732c9988b5d1 Mon Sep 17 00:00:00 2001 From: Martin Gorgas Date: Tue, 12 Mar 2024 11:56:00 +0100 Subject: [PATCH 6/6] fixes 'Undefined array key "link"' error --- classes/GUI/class.ilTestOverviewTableGUI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/GUI/class.ilTestOverviewTableGUI.php b/classes/GUI/class.ilTestOverviewTableGUI.php index 1864b96..6906fa7 100755 --- a/classes/GUI/class.ilTestOverviewTableGUI.php +++ b/classes/GUI/class.ilTestOverviewTableGUI.php @@ -747,7 +747,7 @@ public function fillHeader(): void include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php"); ilTooltipGUI::addTooltip("thc_" . $this->getId() . "_" . $ccnt, $column["tooltip"]); } - if ((!$this->enabled["sort"] || $column["sort_field"] == "" || $column["is_checkbox_action_column"]) && !$column['link']) { + if ((!$this->enabled["sort"] || $column["sort_field"] == "" || $column["is_checkbox_action_column"]) && (!isset($column['link']) || !$column['link'])) { $this->tpl->setCurrentBlock("tbl_header_no_link"); if ($column["width"] != "") { $this->tpl->setVariable("TBL_COLUMN_WIDTH_NO_LINK", " width=\"" . $column["width"] . "\""); @@ -803,7 +803,7 @@ public function fillHeader(): void if ($column["class"] != "") { $this->tpl->setVariable("TBL_HEADER_CLASS", " " . $column["class"]); } - if($column['link']) { + if(isset($column['link']) { $this->setExternalLink($column['link']); } else { $this->setOrderLink($column["sort_field"], $order_dir);