From 96d351c2a2cdc068f0912c2fb03d7014800188f6 Mon Sep 17 00:00:00 2001 From: Monique Hansma Date: Thu, 22 Oct 2026 13:29:04 +0200 Subject: [PATCH] groepen: archiveerOS/activeerOS voegden altijd een lege rij in insert_record() stond buiten de else (geen accolades), waardoor bij een bestaande koppeling een lege rij in tb_aantalxondersteuningsvorm kwam plus een warning over $data. activeerOS maakt een nieuwe koppeling nu actief aan (archief 'F'). Co-Authored-By: Claude Opus 5.5 --- application/controllers/monpas/Groepen.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/application/controllers/monpas/Groepen.php b/application/controllers/monpas/Groepen.php index 634017f..72605db 100644 --- a/application/controllers/monpas/Groepen.php +++ b/application/controllers/monpas/Groepen.php @@ -332,13 +332,14 @@ class Groepen extends MY_Controller{ $orgID = $this->clean_input('orgID'); $axovID =$this->Aantalxondersteuningsvorm_model->get_fieldvalue(["ondersteuningsvorm_id"=> $vormID, "groep_id" => $groepID], "id"); if ($axovID) $this->Aantalxondersteuningsvorm_model->update_record(["archief"=> 'T', "aantal"=> 0], $axovID); - else $data = [ 'organisatie_id' => $orgID, + else { + $data = [ 'organisatie_id' => $orgID, 'groep_id' => $groepID, 'ondersteuningsvorm_id' => $vormID, 'archief' => 'T', 'aantal' => 0]; - - $newid = $this->Aantalxondersteuningsvorm_model->insert_record($data); + $newid = $this->Aantalxondersteuningsvorm_model->insert_record($data); + } } function activeerOS(){ @@ -349,13 +350,14 @@ class Groepen extends MY_Controller{ $orgID = $this->clean_input('orgID'); $axovID =$this->Aantalxondersteuningsvorm_model->get_fieldvalue(["ondersteuningsvorm_id"=> $vormID, "groep_id" => $groepID], "id"); if ($axovID) $this->Aantalxondersteuningsvorm_model->update_record(["archief"=> 'F'], $axovID); - else $data = [ 'organisatie_id' => $orgID, - 'groep_id' => $groepID, - 'ondersteuningsvorm_id' => $vormID, - 'archief' => 'T', - 'aantal' => 0]; - - $newid = $this->Aantalxondersteuningsvorm_model->insert_record($data); + else { + $data = [ 'organisatie_id' => $orgID, + 'groep_id' => $groepID, + 'ondersteuningsvorm_id' => $vormID, + 'archief' => 'F', + 'aantal' => 0]; + $newid = $this->Aantalxondersteuningsvorm_model->insert_record($data); + } } function getwriter(){ $writer = false;