Fix: clone object before all treatment
This commit is contained in:
parent
7213ae09fe
commit
08f87515af
@ -380,9 +380,6 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur);
|
dol_syslog(get_class($this)."::Update id=".$id." call_trigger=".$call_trigger." allowmodcodeclient=".$allowmodcodeclient." allowmodcodefournisseur=".$allowmodcodefournisseur);
|
||||||
|
|
||||||
// For triggers
|
|
||||||
if ($call_trigger) $this->oldobject = dol_clone($this);
|
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
|
|||||||
@ -102,7 +102,11 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
|
||||||
|
|
||||||
if ($action == 'update') $object->fetch($socid);
|
if ($action == 'update')
|
||||||
|
{
|
||||||
|
$ret=$object->fetch($socid);
|
||||||
|
$object->oldcopy=dol_clone($object);
|
||||||
|
}
|
||||||
else $object->canvas=$canvas;
|
else $object->canvas=$canvas;
|
||||||
|
|
||||||
if (GETPOST("private") == 1)
|
if (GETPOST("private") == 1)
|
||||||
@ -317,8 +321,6 @@ if (empty($reshook))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->oldcopy=dol_clone($object);
|
|
||||||
|
|
||||||
// To not set code if third party is not concerned. But if it had values, we keep them.
|
// To not set code if third party is not concerned. But if it had values, we keep them.
|
||||||
if (empty($object->client) && empty($object->oldcopy->code_client)) $object->code_client='';
|
if (empty($object->client) && empty($object->oldcopy->code_client)) $object->code_client='';
|
||||||
if (empty($object->fournisseur)&& empty($object->oldcopy->code_fournisseur)) $object->code_fournisseur='';
|
if (empty($object->fournisseur)&& empty($object->oldcopy->code_fournisseur)) $object->code_fournisseur='';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user