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() ) ); diff --git a/classes/GUI/class.ilTestOverviewTableGUI.php b/classes/GUI/class.ilTestOverviewTableGUI.php index 8d41db2..6906fa7 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'])) { @@ -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); @@ -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..10d74d7 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) { @@ -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; } 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; } /**