Bugzilla – Attachment 171481 Details for
Bug 37524
Pressing "Renew all" redirects user to "Export data" tool if one of the items is not renewable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37524: Do not attempt to renew check outs if there is nothing to renew
Bug-37524-Do-not-attempt-to-renew-check-outs-if-th.patch (text/plain), 2.61 KB, created by
Paul Derscheid
on 2024-09-13 15:29:15 UTC
(
hide
)
Description:
Bug 37524: Do not attempt to renew check outs if there is nothing to renew
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2024-09-13 15:29:15 UTC
Size:
2.61 KB
patch
obsolete
>From 66c6e2a5c016a832860159ae457a2f03af5e9120 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Tue, 30 Jul 2024 15:43:08 +0300 >Subject: [PATCH] Bug 37524: Do not attempt to renew check outs if there is > nothing to renew > >If patrons loans are not renewable and one hits "Renew all" >button in patrons "Check out" page, Koha is redirected to >"Export data" tool. This happens because when there is >nothing to renew call to function renew_all produces error: >"Uncaught TypeError: renew_all(...) is undefined". This >patch prevents call to this function and adds alert to >inform user that there are no items to be renewed. > >To reproduce: >1. Find patron with check outs which renewals count has hit >the maximum limit of renewals. >2. Press "Renew all" button. >=> Koha is redirected to "Export data" tool. >3. Apply this patch. >4. Try to renew check outs again. >=> Alert pop up is displayed. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 29 ++++++++++++-------- > 1 file changed, 17 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 64979297be..ca3e2444c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -740,20 +740,25 @@ $(document).ready(function() { > > let item_ids = $(".renew:checked:visible").map((i, c) => c.value); > >- renew_all(item_ids, renew).then(() => { >- // Refocus on barcode field if it exists >- if ( $("#barcode").length ) { >- $("#barcode").focus(); >- } >+ if( item_ids.length > 0 ){ >+ renew_all(item_ids, renew).then(() => { >+ // Refocus on barcode field if it exists >+ if ( $("#barcode").length ) { >+ $("#barcode").focus(); >+ } > >- if ( refresh_table ) { >- RefreshIssuesTable(); >- } >- $('#RenewChecked, #CheckinChecked').prop('disabled' , true ); >- }); >+ if ( refresh_table ) { >+ RefreshIssuesTable(); >+ } >+ $('#RenewChecked, #CheckinChecked').prop('disabled' , true ); >+ }); >+ >+ // Prevent form submit >+ return false; >+ } else { >+ alert(_("There are no items to be renewed.")); >+ } > >- // Prevent form submit >- return false; > }); > > $("#RenewAll").on("click",function(){ >-- >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 37524
:
169859
|
169866
| 171481 |
171482