From d89d75f72bb1a4db48cb7b6d1b10f020292bfa80 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 8 Oct 2021 12:17:51 +0200 Subject: [PATCH] Fix handling disableOnSuccessMsg parameter on LSobject customActions --- src/includes/routes.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/includes/routes.php b/src/includes/routes.php index be320591..78d1d17f 100644 --- a/src/includes/routes.php +++ b/src/includes/routes.php @@ -1384,16 +1384,18 @@ function handle_LSobject_customAction($request) { if (isset($_GET['valid']) || LSconfig :: get('noConfirmation', false, 'bool', $config)) { LStemplate :: assign('pagetitle', $title.' : '.$objectname); if (call_user_func_array($function, array(&$object))) { - $msg_format = LSconfig :: get('onSuccessMsgFormat', null, 'string', $config); - if ($msg_format) { - $msg = getFData(__($msg_format), $objectname); - } else { - $msg = getFData( - _('The custom action %{customAction} have been successfully execute on %{objectname}.'), - array('objectname' => $objectname, 'customAction' => $customAction) - ); + if (!LSconfig :: get('disableOnSuccessMsg', false, 'bool', $config)) { + $msg_format = LSconfig :: get('onSuccessMsgFormat', null, 'string', $config); + if ($msg_format) { + $msg = getFData(__($msg_format), $objectname); + } else { + $msg = getFData( + _('The custom action %{customAction} have been successfully execute on %{objectname}.'), + array('objectname' => $objectname, 'customAction' => $customAction) + ); + } + LSsession :: addInfo($msg); } - LSsession :: addInfo($msg); if (LSconfig :: get('redirectToObjectList', false, 'bool', $config)) { LSurl :: redirect("object/$LSobject?refresh");