From 0ae0ceb5d9c6e3cb8e2e3d6a5c4c9e8c004bc699 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Thu, 11 Sep 2025 16:14:20 +0200 Subject: [PATCH] Bugfix: Stv Verband springt --- .../api/frontend/v1/stv/Verband.php | 1 + .../Stv/Studentenverwaltung/Verband.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/application/controllers/api/frontend/v1/stv/Verband.php b/application/controllers/api/frontend/v1/stv/Verband.php index 4060704de..6487b6263 100644 --- a/application/controllers/api/frontend/v1/stv/Verband.php +++ b/application/controllers/api/frontend/v1/stv/Verband.php @@ -188,6 +188,7 @@ class Verband extends FHCAPI_Controller array_unshift($list, [ 'name' => 'PreStudent', 'link' => $link . 'prestudent', + 'stg_kz' => (int)$studiengang_kz, 'children' => $this->getStdSem($link . 'prestudent/', $studiengang_kz) ]); diff --git a/public/js/components/Stv/Studentenverwaltung/Verband.js b/public/js/components/Stv/Studentenverwaltung/Verband.js index 9a34033ce..ccd555714 100644 --- a/public/js/components/Stv/Studentenverwaltung/Verband.js +++ b/public/js/components/Stv/Studentenverwaltung/Verband.js @@ -190,6 +190,24 @@ export default { if (!currentNode) return; + const currentSelectedKey = Object.keys(this.selectedKey).find(Boolean); + if (currentSelectedKey) { + if (currentSelectedKey == currentKey) + return; + /** + * Do not select a new entry if the current is a child of the new one. + * This happens if a child entry of a new stg is selected and the router + * tries to select the stg root entry (because subtrees do not have + * routes yet) + */ + const isChild = this.findNodeByKey( + currentSelectedKey, + currentNode.children + ); + if (isChild) + return; + } + for (let i = 1; i < parts.length; i++) { this.expandedKeys[currentNode.key] = true;