FIX missing executeHooks

This commit is contained in:
Regis Houssin 2022-05-10 12:56:22 +02:00
parent 1e8547dd44
commit 6f8eef9550

View File

@ -173,7 +173,12 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
// Create the global $hookmanager object
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager = new HookManager($db);
$reshook = $hookmanager->initHooks(array('doUpgradeBefore'));
$hookmanager->initHooks(array('upgrade2'));
$parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto);
$object = new stdClass();
$action = "upgrade";
$reshook = $hookmanager->executeHooks('doUpgradeBefore', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook >= 0 && is_array($hookmanager->resArray)) {
// Example: $hookmanager->resArray = array(2, 3, 10);
$listofentities = array_unique(array_merge($listofentities, $hookmanager->resArray));