diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index de19d651ba2..d7d41a545ef 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9455,6 +9455,12 @@ abstract class CommonObject } } + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) { + $error++; + } + if (!$error && !empty($this->isextrafieldmanaged)) { $result = $this->deleteExtraFields(); if ($result < 0) { @@ -9472,12 +9478,6 @@ abstract class CommonObject } } - // Delete linked object - $res = $this->deleteObjectLinked(); - if ($res < 0) { - $error++; - } - // Commit or rollback if ($error) { $this->db->rollback();