Merge pull request #11526 from atm-ph/fix_9.0_missing_hook

Fix missing hook then can't interact with actions
This commit is contained in:
Laurent Destailleur 2019-07-18 17:24:08 +02:00 committed by GitHub
commit b0baba3293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 72 additions and 51 deletions

View File

@ -61,11 +61,20 @@ if ($id > 0 || ! empty($ref))
} }
} }
$hookmanager->initHooks(array('directdebitcard','globalcard'));
/* /*
* Actions * Actions
*/ */
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if ($action == "new") if ($action == "new")
{ {
if ($object->id > 0) if ($object->id > 0)
@ -100,6 +109,7 @@ if ($action == "delete")
} }
} }
} }
}
/* /*

View File

@ -51,10 +51,20 @@ $page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page; $offset = $limit * $page;
$hookmanager->initHooks(array('directdebitcreatecard','globalcard'));
/* /*
* Actions * Actions
*/ */
$parameters = array('mode' => $mode, 'format' => $format, 'limit' => $limit, 'page' => $page, 'offset' => $offset);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
// Change customer bank information to withdraw // Change customer bank information to withdraw
if ($action == 'modify') if ($action == 'modify')
{ {
@ -89,6 +99,7 @@ if ($action == 'create')
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
} }
} }
}
/* /*