From 81497687e9cbb4925a50961ebb5747fe64643882 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Jun 2018 10:55:36 +0200 Subject: [PATCH] Fix missing oldcopy in trigger call --- htdocs/contrat/card.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index d1b53e58495..83b8e75a8fd 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -897,10 +897,7 @@ if (empty($reshook)) $cancelbutton = GETPOST('cancel','alpha'); if (!$cancelbutton) { - $result = $object->fetch($id); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + $object->oldcopy = dol_clone($object); $result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); if ($result < 0) { @@ -922,10 +919,7 @@ if (empty($reshook)) if (!$cancelbutton) { - $result = $object->fetch($id); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + $object->oldcopy = dol_clone($object); $result = $object->setValueFrom('ref_customer', GETPOST('ref_customer','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); if ($result < 0) {