From eb22947c07165dec6c56a942c9804012a4570398 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 72f83317fb3..5d2eb217031 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -721,7 +721,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) @@ -737,18 +748,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