From 30c4e565dd58070fb5d155829b753ae6aee330bc Mon Sep 17 00:00:00 2001 From: chfhtw Date: Tue, 11 Aug 2026 15:08:34 +0200 Subject: [PATCH] bugfix: sprache index in studentlistlib corrected --- application/libraries/stv/StudentListLib.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/application/libraries/stv/StudentListLib.php b/application/libraries/stv/StudentListLib.php index 293d74932..8826b50b8 100644 --- a/application/libraries/stv/StudentListLib.php +++ b/application/libraries/stv/StudentListLib.php @@ -320,16 +320,9 @@ class StudentListLib * @param string studiensemester_kurzbz * */ - protected function addSelectAndJoinForTagsIfConfigured($studiensemester_kurzbz) - { + protected function addSelectAndJoinForTagsIfConfigured($studiensemester_kurzbz) + { if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) { - - $this->_ci->load->model('system/Sprache_model', 'SpracheModel'); - $this->_ci->SpracheModel->addSelect('index'); - $result = $this->_ci->SpracheModel->loadWhere(array('sprache' => getUserLanguage())); - $language = hasData($result) ? getData($result)[0]->index : 1; - $index_bezeichnung_mehrsprachig = $language - 1; - $this->_ci->load->config('stv'); $tags = $this->_ci->config->item('stv_prestudent_tags'); @@ -351,7 +344,11 @@ class StudentListLib SELECT DISTINCT ON (n.notiz_id) n.notiz_id AS id, nt.typ_kurzbz, - array_to_json(nt.bezeichnung_mehrsprachig)->>". $index_bezeichnung_mehrsprachig . " AS beschreibung, + nt.bezeichnung_mehrsprachig[( + SELECT index + FROM tbl_sprache + WHERE sprache=" . $this->_ci->PrestudentModel->escape(getUserLanguage()) . " + )] AS beschreibung, n.text AS notiz, nt.style, n.erledigt AS done, @@ -387,7 +384,7 @@ class StudentListLib $this->addSelect('tag_data_agg.tags'); $this->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT'); } - } + } /** * Get alias of a table or select statement