diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 5709fcb7647..86eb5af261e 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -470,11 +470,14 @@ class Adherent extends CommonObject $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } + if (empty($conf->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } } else if ($reshook < 0) $error++; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index bf0f5057179..6be129c8b06 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -271,10 +271,13 @@ class Contact extends CommonObject $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - $result=$this->insertExtraFields(); - if ($result < 0) + if (empty($conf->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $error++; + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } } } else if ($reshook < 0) $error++; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index d6290ce6345..209d5bbe39c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -497,11 +497,14 @@ class Product extends CommonObject $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } + if (empty($conf->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } } else if ($reshook < 0) $error++; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d978b2cc59d..4e608f817ff 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -580,11 +580,14 @@ class Societe extends CommonObject $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } + if (empty($conf->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } } else if ($reshook < 0) $error++;