Bugzilla – Attachment 171245 Details for
Bug 37880
Unwanted form submission on RenewAll button
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37880: Fix unwanted form submission on RenewAll button
Bug-37880-Fix-unwanted-form-submission-on-RenewAll.patch (text/plain), 1.34 KB, created by
Peter Vashchuk
on 2024-09-10 10:01:10 UTC
(
hide
)
Description:
Bug 37880: Fix unwanted form submission on RenewAll button
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2024-09-10 10:01:10 UTC
Size:
1.34 KB
patch
obsolete
>From 9ef9a6da4efe1a7c1ec982c0da6ba92d204420dd Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Tue, 10 Sep 2024 13:00:27 +0300 >Subject: [PATCH] Bug 37880: Fix unwanted form submission on RenewAll button > >Currently when there's 0 renewable items and you press RenewAll button, >js does pointless form submission. > >Steps to reproduce: >1. Have a patron with one or more holds that shouldn't be possible to renew. >2. Press RenewAll button. >3. Apply the patch. >4. Repeat step 2 but this time you should get "There is no items to renew." alert. >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 64979297be..f414de1996 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -739,6 +739,11 @@ $(document).ready(function() { > } > > let item_ids = $(".renew:checked:visible").map((i, c) => c.value); >+ if ( item_ids.length == 0 ) { >+ // Skip if no items to renew otherwise we will die in .then below >+ alert( __("There is no items to renew.") ); >+ return false; >+ } > > renew_all(item_ids, renew).then(() => { > // Refocus on barcode field if it exists >-- >2.46.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37880
:
171245
|
171458