Fix missing oldcopy in trigger call

This commit is contained in:
Laurent Destailleur 2018-06-22 10:55:36 +02:00
parent 88d3bf0148
commit 81497687e9

View File

@ -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) {