From 6860325f96f1abf5c936a005198edbb171caa8ad Mon Sep 17 00:00:00 2001 From: kkhelifa Date: Thu, 30 Mar 2023 11:13:17 +0200 Subject: [PATCH] Correction --- htdocs/product/class/html.formproduct.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 14457c312ed..f9ea6b54beb 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -867,8 +867,11 @@ class FormProduct $productIdList = implode(',', $productIdArray); $batch_count = 0; - include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; - $hookmanager = new HookManager($this->db); + global $hookmanager; + if (empty($hookmanager)) { + include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($this->db); + } $hookmanager->initHooks(array('productdao')); $parameters = array('productIdList' => $productIdList); $reshook = $hookmanager->executeHooks('loadLotStock', $parameters, $this);