From ca66eac76c86585536344be88935b229ff9d121a Mon Sep 17 00:00:00 2001 From: oscim Date: Mon, 29 Jun 2020 14:01:48 +0200 Subject: [PATCH] Update project.class.php Fix order of delete extra prev table of project --- htdocs/projet/class/project.class.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 860a6b6b92f..a0b6e38423b 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -747,7 +747,18 @@ class Project extends CommonObject } } + if (!$error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_extrafields"; + $sql .= " WHERE fk_object=".$this->id; + $resql = $this->db->query($sql); + if (!$resql) + { + $this->errors[] = $this->db->lasterror(); + $error++; + } + } // Delete project if (!$error) @@ -763,18 +774,7 @@ class Project extends CommonObject } } - if (!$error) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_extrafields"; - $sql .= " WHERE fk_object=".$this->id; - $resql = $this->db->query($sql); - if (!$resql) - { - $this->errors[] = $this->db->lasterror(); - $error++; - } - } if (empty($error)) { // We remove directory