forked from Wavyzz/dolibarr
FIX update extrafields
This commit is contained in:
@@ -222,7 +222,7 @@ class Fichinter extends CommonObject
|
||||
if (! $resql) $error++;
|
||||
}
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))
|
||||
{
|
||||
$result=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
@@ -285,6 +285,8 @@ class Fichinter extends CommonObject
|
||||
$this->fk_project = 0;
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET ";
|
||||
@@ -299,8 +301,16 @@ class Fichinter extends CommonObject
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||
{
|
||||
$result=$this->insertExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $notrigger)
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('FICHINTER_MODIFY',$user);
|
||||
@@ -372,8 +382,7 @@ class Fichinter extends CommonObject
|
||||
|
||||
if ($this->statut == 0) $this->brouillon = 1;
|
||||
|
||||
// Retreive all extrafield
|
||||
// fetch optionals attributes and labels
|
||||
// Retreive extrafields
|
||||
$this->fetch_optionals();
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user