Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Add missing hook context to parameters array #1

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions htdocs/product/stock/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

$error = 0;

$parameters = array('id' => $id, 'ref' => $ref);
$parameters = array('context' => 'warehousecard', 'id' => $id, 'ref' => $ref);
$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');
Expand Down Expand Up @@ -439,7 +439,7 @@
}

// Call Hook formConfirm
$parameters = array('formConfirm' => $formconfirm);
$parameters = array('context' => 'warehousecard', 'formConfirm' => $formconfirm);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$formconfirm .= $hookmanager->resPrint;
Expand Down Expand Up @@ -599,7 +599,7 @@
*/
print "<div class=\"tabsAction\">\n";

$parameters = array();
$parameters = array('context' => 'warehousecard');
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
if (empty($action) || $action == 'classin') {
Expand Down Expand Up @@ -634,7 +634,7 @@
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent liste">';
print '<tr class="liste_titre">';
$parameters = array('totalarray' => &$totalarray);
$parameters = array('context' => 'warehousecard', 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

Expand Down Expand Up @@ -680,7 +680,7 @@
$totalarray['nbfield']++;
}
// Hook fields
$parameters = array('sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
$parameters = array('context' => 'warehousecard', 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print "</tr>\n";
Expand Down Expand Up @@ -714,7 +714,7 @@
}
$sql .= ", (ps.reel * p.pmp) as svalue";
// Add fields from hooks
$parameters = array();
$parameters = array('context' => 'warehousecard');
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
if ($reshook > 0) { //Note that $sql is replaced if reshook > 0
$sql = "";
Expand Down Expand Up @@ -847,7 +847,7 @@
print "</a></td>";
}

$parameters = array('obj' => $objp, 'totalarray' => &$totalarray);
$parameters = array('context' => 'warehousecard', 'obj' => $objp, 'totalarray' => &$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

Expand All @@ -871,7 +871,7 @@
$totalarray['val']['totalvaluesell'] = price2num($totalvaluesell, 'MT');
$totalarray['val']['units'] = $langs->trans($productstatic->getLabelOfUnit());

$parameters = array('totalarray' => &$totalarray);
$parameters = array('context' => 'warehousecard', 'totalarray' => &$totalarray);
// Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldListTotal', $parameters, $object);
if ($reshook < 0) {
Expand Down Expand Up @@ -976,7 +976,7 @@
print '</td></tr>';

// Other attributes
$parameters = array('colspan' => ' colspan="3"', 'cols' => '3');
$parameters = array('context' => 'warehousecard', 'colspan' => ' colspan="3"', 'cols' => '3');
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
Expand Down
Loading