diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 4139176e84e..9de1672db90 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -250,6 +250,7 @@ if (empty($reshook)) if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->contact->supprimer) { $result=$object->fetch($id); + $object->oldcopy = clone $object; $object->old_lastname = GETPOST("old_lastname"); $object->old_firstname = GETPOST("old_firstname"); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 39754b14fe0..e2a8f731856 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -817,6 +817,7 @@ if (empty($reshook)) if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer) { $object->fetch($socid); + $object->oldcopy = clone $object; $result = $object->delete($socid, $user); if ($result > 0) diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index b2432afe243..cfddddb7b96 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -292,7 +292,7 @@ class Contacts extends DolibarrApi { throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } - + $this->contact->oldcopy = clone $this->contact; return $this->contact->delete($id); } diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 3d2104cc6f2..ed3b26e04ac 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -418,7 +418,7 @@ class Thirdparties extends DolibarrApi // External modules should update their ones too if (!$errors) { -$reshook = $hookmanager->executeHooks('replaceThirdparty', array( + $reshook = $hookmanager->executeHooks('replaceThirdparty', array( 'soc_origin' => $soc_origin->id, 'soc_dest' => $object->id ), $soc_dest, $action); @@ -488,6 +488,7 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( if( ! DolibarrApi::_checkAccessToResource('societe', $this->company->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } + $this->company->oldcopy = clone $this->company; return $this->company->delete($id); } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index bdef850fa6b..edcb99678bb 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -156,6 +156,7 @@ if (empty($reshook)) { $object = new User($db); $object->fetch($id); + $object->oldcopy = clone $object; $result = $object->delete($user); if ($result < 0) { diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 72690c65dcb..9549fbe2ef1 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -350,7 +350,7 @@ class Users extends DolibarrApi { throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } - + $this->useraccount->oldcopy = clone $this->useraccount; return $this->useraccount->delete(DolibarrApiAccess::$user); }