diff --git a/application/controllers/api/frontend/v1/stv/Dokumente.php b/application/controllers/api/frontend/v1/stv/Dokumente.php index 9f54d0aa4..b8c7830bd 100644 --- a/application/controllers/api/frontend/v1/stv/Dokumente.php +++ b/application/controllers/api/frontend/v1/stv/Dokumente.php @@ -753,6 +753,10 @@ class Dokumente extends FHCAPI_Controller ); $data = $this->getDataOrTerminateWithError($result); + if(!(is_array($data) && count($data) > 0)) + { + return null; + } $student = current($data); return $student->student_uid; diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Archiv.js b/public/js/components/Stv/Studentenverwaltung/Details/Archiv.js index 9477b08f4..756d9a774 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Archiv.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Archiv.js @@ -225,18 +225,32 @@ export default { return events; }, studentUids() { - if (this.modelValue.uid) + if(Array.isArray(this.modelValue)) + { + return this.modelValue.map(e => e.uid); + } + else if (this.modelValue.uid) { return [this.modelValue.uid]; } - return this.modelValue.map(e => e.uid); + else + { + return []; + } }, studentKzs(){ - if (this.modelValue.uid) + if(Array.isArray(this.modelValue)) + { + return this.modelValue.map(e => e.studiengang_kz); + } + else if (typeof this.modelValue.studiengang_kz !== 'undefined') { return [this.modelValue.studiengang_kz]; } - return this.modelValue.map(e => e.studiengang_kz); + else + { + return []; + } }, stg_kz(){ return this.studentKzs[0];