From 00c85935670661831c6fe20b8cf798e34b381d10 Mon Sep 17 00:00:00 2001 From: All3kcis Date: Wed, 11 Apr 2018 14:09:30 +0200 Subject: [PATCH] remove hook --- .../product/stock/class/productlot.class.php | 36 ++++++------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index c46bb4ffa78..0e15194713a 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -156,23 +156,15 @@ class Productlot extends CommonObject if (!$error) { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); - $action='create'; - // 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)) + // Actions on extra fields + 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(); + if ($result < 0) { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } - else if ($reshook < 0) $error++; if (!$error AND !$notrigger) { // Uncomment this and change MYOBJECT to your own tag if you @@ -331,23 +323,15 @@ class Productlot extends CommonObject dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); } - $action='update'; - // 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)) + // Actions on extra fields + 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(); + if ($result < 0) { - $result=$this->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } - else if ($reshook < 0) $error++; if (!$error && !$notrigger) { // Uncomment this and change MYOBJECT to your own tag if you