Bug 39108: Prevent 'Ignore' on found hold from triggering a new modal

When ignoring a waiting hold, we don't need to take any further action, we
shoudlsimply close the modal

This patch adds JS to prevent form submission

To test:
1 - place a hold
2 - check in an item that can fill the hold
3 - in the hold found modal, click Ignore
4 - the modal dismisses and nothing changes on the hold (this is the desired behavior)
5 - check in the item again, click Confirm Hold, confirm your hold is now Waiting
6 - check in the item again, confirm the modal says "Item is already waiting"
7 - click Ignore, confirm modal reloads
8 - click Ignore, confirm modal reloads
9 - click Ignore, confirm modal reloads
10 - Apply patch
11 - check in the item again, click Confirm Hold, confirm your hold is now Waiting
12 - check in the item again, confirm the modal says "Item is already waiting"
13 - click Ignore, nothign happens! Orange you glad I didn't say banana?

Signed-off-by: Amanda Campbell <acampbell@hmcpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Nick Clemens 2025-02-21 13:42:13 +00:00 committed by Katrin Fischer
parent 9fdc303af4
commit 177d648ded
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 4 additions and 1 deletions

View File

@ -733,7 +733,7 @@
<input type="hidden" name="print_slip" value="0" />
<button type="button" class="btn btn-default print" accesskey="P"> <i class="fa fa-print"></i> Print slip and confirm (P) </button>
<button data-bs-dismiss="modal" type="submit" class="btn btn-default" accesskey="I"> <i class="fa fa-times"></i> Ignore (I) </button>
<button data-bs-dismiss="modal" type="submit" class="btn btn-default ignore" accesskey="I"> <i class="fa fa-times"></i> Ignore (I) </button>
<fieldset class="action">
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
@ -1618,6 +1618,9 @@
if ( barcode ) barcode.remove();
this.form.submit();
});
$(".ignore").on("click",function(e){
e.preventDefault();
});
$('.cancel-hold').on("click",function(e){
let cancel_form = document.getElementById('cancellation-reason');
let cancel_reason = '';