Bug 42193: Fix the "Suspend Hold" modal in the OPAC

In the OPAC, the "Suspend Hold" modal sometimes shows up as (and acts like) a "Resume Hold" modal. The reason for this is a left over "HOLD.suspend" in the template. "HOLD" should not be used in this template and is set as a side effect of the processing of "holds-table.inc".

Since there is a separate form that exist for the "Resume" action and the modal is only needed for suspension, this patch simply removes the inacurate conditional in the modal definition.

To test :
1. Have at least 2 holds.
2. In the holds table in the OPAC, make sure all holds are active and have a "Suspend" link.
3. Click the "Suspend" link on the newest hold (with the highest reserve_id).
    => The modal is titled "Suspend hold" and submitting it correctly suspends the hold.
4. Click the "Suspend" link on any of the other hold.
    => The modal is titled "Resume hold" and submitting it doesn't suspends the hold.
5. Apply patch
6. Repeat step 4.
    => The modal is titled "Suspend hold" and submitting it correctly suspends the hold.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4112dde941)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
Maryse Simard 2026-03-26 10:23:50 -04:00 committed by Baptiste Wojtkowski
parent 5631e8a4e7
commit 4b16cf0afc
No known key found for this signature in database
GPG Key ID: 47A8A13E10BC0D40
1 changed files with 0 additions and 5 deletions

View File

@ -1010,13 +1010,8 @@
<form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<div class="modal-header">
[% IF HOLD.suspend %]
<h1 class="modal-title" id="suspendModalLabel">Resume hold</h1>
<input type="hidden" name="op" value="cud-unsuspend" />
[% ELSE %]
<h1 class="modal-title" id="suspendModalLabel">Suspend hold</h1>
<input type="hidden" name="op" value="cud-suspend" />
[% END %]
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">