diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 50660a9261c..3a438675059 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1913,7 +1913,9 @@ if ($resql) { } } if ($user->hasRight('banque', 'modifier')) { - $parambis = preg_replace('/action=reconcile/', '', $param); + // Strip the surrounding & so the leading action= we put first stays the only action= in the URL. + // Without this the URL ends up with two action= params; PHP picks the last one and the page silently switches to 'reconcile' instead of 'delete'. + $parambis = preg_replace('/&?action=(reconcile|confirm_deleteonreconcile)(&|$)/', '\2', $param); print ''; print img_delete('', 'class="marginleftonly"'); print '';