From 5fbcc60c67864323c197f85b29fb6913b40859b4 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Wed, 8 Oct 2025 14:37:25 +0200 Subject: [PATCH] fix bug when editing profile request adding a file and no previous file exists --- application/controllers/api/frontend/v1/ProfilUpdate.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/application/controllers/api/frontend/v1/ProfilUpdate.php b/application/controllers/api/frontend/v1/ProfilUpdate.php index e5129b678..e4eb4783e 100644 --- a/application/controllers/api/frontend/v1/ProfilUpdate.php +++ b/application/controllers/api/frontend/v1/ProfilUpdate.php @@ -716,13 +716,12 @@ class ProfilUpdate extends FHCAPI_Controller private function deleteOldVersionFile($dms_id) { + if (!isset($dms_id)) { + return true; + } + // starting the transaction $this->db->trans_start(); - - - if (!isset($dms_id)) { - return; - } //? delete the file from the profilUpdate first $profilUpdateFileDelete = $this->ProfilUpdateModel->removeFileFromProfilUpdate($dms_id);