Merge pull request #20815 from hregis/fix_missing_execute_hook
FIX missing executeHooks
This commit is contained in:
commit
67566a6064
@ -173,7 +173,12 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
|
|||||||
// Create the global $hookmanager object
|
// Create the global $hookmanager object
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
$hookmanager = new HookManager($db);
|
$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)) {
|
if ($reshook >= 0 && is_array($hookmanager->resArray)) {
|
||||||
// Example: $hookmanager->resArray = array(2, 3, 10);
|
// Example: $hookmanager->resArray = array(2, 3, 10);
|
||||||
$listofentities = array_unique(array_merge($listofentities, $hookmanager->resArray));
|
$listofentities = array_unique(array_merge($listofentities, $hookmanager->resArray));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user