remove hook

This commit is contained in:
All3kcis 2018-04-11 14:09:30 +02:00 committed by GitHub
parent 3cc3816391
commit 00c8593567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,13 +156,7 @@ class Productlot extends CommonObject
if (!$error) { if (!$error) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
$action='create'; // Actions on extra fields
// Actions on extra fields (by external module or standard code)
$hookmanager->initHooks(array('productlotdao'));
$parameters=array('id'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{ {
$result=$this->insertExtraFields(); $result=$this->insertExtraFields();
@ -171,8 +165,6 @@ class Productlot extends CommonObject
$error++; $error++;
} }
} }
}
else if ($reshook < 0) $error++;
if (!$error AND !$notrigger) { if (!$error AND !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
@ -331,13 +323,7 @@ class Productlot extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
} }
$action='update'; // Actions on extra fields
// Actions on extra fields (by external module or standard code)
$hookmanager->initHooks(array('productlotdao'));
$parameters=array('id'=>$this->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{ {
$result=$this->insertExtraFields(); $result=$this->insertExtraFields();
@ -346,8 +332,6 @@ class Productlot extends CommonObject
$error++; $error++;
} }
} }
}
else if ($reshook < 0) $error++;
if (!$error && !$notrigger) { if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you