From 239a9c89d71d531bcc64ec3cd3976f315616dc8d Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 24 Nov 2025 09:46:53 +0100 Subject: [PATCH 1/2] compare DateTime with DateTime instead of String --- application/controllers/api/frontend/v1/stv/Pruefung.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/api/frontend/v1/stv/Pruefung.php b/application/controllers/api/frontend/v1/stv/Pruefung.php index 56f0d9597..d68e89532 100644 --- a/application/controllers/api/frontend/v1/stv/Pruefung.php +++ b/application/controllers/api/frontend/v1/stv/Pruefung.php @@ -319,12 +319,13 @@ class Pruefung extends FHCAPI_Controller $note = current($zeugnisnoten); $uebernahmedatum = new DateTime($note->uebernahmedatum); $benotungsdatum = new DateTime($note->benotungsdatum); + $pruefungsdatum = new DateTime($this->input->post('datum')); $checkDate = $uebernahmedatum === '' || $benotungsdatum > $uebernahmedatum ? $benotungsdatum : $uebernahmedatum; - if ($checkDate >= $this->input->post('datum') && $this->input->post('note') !== $note->note) + if ($checkDate >= $pruefungsdatum) && $this->input->post('note') !== $note->note) { $this->PruefungModel->db->trans_complete(); $this->terminateWithSuccess($this->p->t('exam', 'hinweis_changeAfterExamDate')); From cdc1933ce4c16a6f3e241bc7650e8eba34242076 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Mon, 24 Nov 2025 09:48:05 +0100 Subject: [PATCH 2/2] fix typo --- application/controllers/api/frontend/v1/stv/Pruefung.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/api/frontend/v1/stv/Pruefung.php b/application/controllers/api/frontend/v1/stv/Pruefung.php index d68e89532..a539a4d79 100644 --- a/application/controllers/api/frontend/v1/stv/Pruefung.php +++ b/application/controllers/api/frontend/v1/stv/Pruefung.php @@ -325,7 +325,7 @@ class Pruefung extends FHCAPI_Controller ? $benotungsdatum : $uebernahmedatum; - if ($checkDate >= $pruefungsdatum) && $this->input->post('note') !== $note->note) + if ($checkDate >= $pruefungsdatum && $this->input->post('note') !== $note->note) { $this->PruefungModel->db->trans_complete(); $this->terminateWithSuccess($this->p->t('exam', 'hinweis_changeAfterExamDate'));