Merge pull request #21024 from atm-john/15.0_fix_btn_confirm_url

Fix btn confirm url
This commit is contained in:
Laurent Destailleur 2022-05-25 16:56:54 +02:00 committed by GitHub
commit 1dd2ce0399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10051,9 +10051,11 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
// Js Confirm button
if ($userRight && !empty($params['confirm'])) {
if (!is_array($params['confirm'])) {
$params['confirm'] = array(
'url' => $url . (strpos($url, '?') > 0 ? '&' : '?') . 'confirm=yes'
);
$params['confirm'] = array();
}
if (empty($params['confirm']['url'])) {
$params['confirm']['url'] = $url . (strpos($url, '?') > 0 ? '&' : '?') . 'confirm=yes';
}
// for js desabled compatibility set $url as call to confirm action and $params['confirm']['url'] to confirmed action