From 118787934c9fe1f7b7269f359cf9766dbf712277 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Mon, 5 Dec 2022 00:29:04 +0100 Subject: [PATCH 1/3] fix #23099 : pass massaction to hook instead of action --- htdocs/core/tpl/massactions_pre.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index dc0a9d4bb8c..973ffe3123a 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -197,7 +197,7 @@ $parameters = array( 'uploaddir' => isset($uploaddir) ? $uploaddir : null ); -$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action); +$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $massaction); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } else { From 51ab2fe3b17e94d6dabb6a19e8513194f42a3e40 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Mon, 5 Dec 2022 00:32:01 +0100 Subject: [PATCH 2/3] better fix to be more close to doMassActions --- htdocs/core/tpl/massactions_pre.tpl.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 973ffe3123a..88d1c812388 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -194,10 +194,11 @@ if ($massaction == 'presend') { // Allow Pre-Mass-Action hook (eg for confirmation dialog) $parameters = array( 'toselect' => $toselect, - 'uploaddir' => isset($uploaddir) ? $uploaddir : null + 'uploaddir' => isset($uploaddir) ? $uploaddir : null, + 'massaction' => $massaction ); -$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $massaction); +$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action); if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } else { From a300f3cfeb5755986224eee774a77823c126ab2b Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Mon, 5 Dec 2022 00:35:06 +0100 Subject: [PATCH 3/3] to be develop compatible --- htdocs/core/tpl/massactions_pre.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 88d1c812388..db959acd0b0 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -193,7 +193,7 @@ if ($massaction == 'presend') { } // Allow Pre-Mass-Action hook (eg for confirmation dialog) $parameters = array( - 'toselect' => $toselect, + 'toselect' => isset($toselect) ? $toselect : array(), 'uploaddir' => isset($uploaddir) ? $uploaddir : null, 'massaction' => $massaction );