From 38d95aa5cdecf66b4757b2fe9fd66df0e57a6932 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Jun 2020 21:45:53 +0200 Subject: [PATCH] Update societe.class.php --- htdocs/societe/class/societe.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0ad6ab22f23..a37830b0ed9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1678,9 +1678,9 @@ class Societe extends CommonObject } } - foreach ($this->childtablesoncascade as $tabletodelete) + if (!$error) { - if (!$error) + foreach ($this->childtablesoncascade as $tabletodelete) { $deleteFromObject=explode(':', $tabletodelete); if (count($deleteFromObject)>=2) { @@ -1693,10 +1693,12 @@ class Societe extends CommonObject if ($result < 0) { $error++; $this->errors[] = $child_object->error; + break; } } else { $error++; - $this->errors[] = 'Cannot find child class file ' .$filepath; + $this->errors[] = 'Cannot include child class file ' .$filepath; + break; } } else { $sql = "DELETE FROM " . MAIN_DB_PREFIX . $tabletodelete; @@ -1704,6 +1706,7 @@ class Societe extends CommonObject if (!$this->db->query($sql)) { $error++; $this->errors[] = $this->db->lasterror(); + break; } } }