diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 09eadbbc8ea..8ebe6f71425 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -688,6 +688,18 @@ class Project extends CommonObject } } + // Remove linked categories. + if (! $error) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX. "categorie_project"; + $sql.= " WHERE fk_project = ". $this->id; + + $result = $this->db->query($sql); + if (! $result) { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + // Fetch tasks $this->getLinesArray($user);