From 1871872c1621944cdfbe5035e459c35604d1b132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 9 Nov 2022 14:53:42 +0100 Subject: [PATCH] clean code --- htdocs/ecm/class/ecmfiles.class.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 0e3f872cefd..46d83cefaa8 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -752,11 +752,8 @@ class EcmFiles extends CommonObject // If you need to delete child tables to, you can insert them here if (!$error) { - $sql = "DELETE FROM " . $this->db->prefix() . $this->table_element. "_extrafields"; - $sql .= " WHERE fk_object = ".((int) $this->id); - - $resql = $this->db->query($sql); - if (!$resql) { + $result = $this->deleteExtraFields(); + if (!$result) { $this->errors[] = $this->db->lasterror(); $error++; }