Bugzilla – Attachment 164734 Details for
Bug 36494
Flatpickr error on checkout page if the patron is blocked from checking out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36494: Flatpickr error on checkout page if the patron is blocked from checking out
Bug-36494-Flatpickr-error-on-checkout-page-if-the-.patch (text/plain), 2.26 KB, created by
Emily Lamancusa (emlam)
on 2024-04-11 14:13:44 UTC
(
hide
)
Description:
Bug 36494: Flatpickr error on checkout page if the patron is blocked from checking out
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2024-04-11 14:13:44 UTC
Size:
2.26 KB
patch
obsolete
>From c3871189ef26319e90a0945673f50f9d92360978 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 2 Apr 2024 17:03:21 +0000 >Subject: [PATCH] Bug 36494: Flatpickr error on checkout page if the patron is > blocked from checking out > >This patch add some error-handling to the recent change to >circulation.tt where we handle dates and on-site checkouts. This >prevents an error in the console when the patron is blocked and the >"specify due date" field is hidden. > >To test, apply the patch and make sure OnSiteCheckouts is enabled. > >- Go to Circulation and check out to a patron. >- Under the restrictions tab, add a manual restriction. >- When the page reloads and the checkout form is no longer visible, > confirm that there is no error in the browser console. > >Confirm that the Bug 18885 test plan still works. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > .../prog/en/modules/circ/circulation.tt | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index d4aa69dc30..d7f07d69ca 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1040,11 +1040,14 @@ > > // On-site checkout > function toggle_onsite_checkout(){ >- const duedatespec_fp = document.querySelector("#duedatespec")._flatpickr; >- if ( $("#onsite_checkout").prop('checked') ) { >- duedatespec_fp.setDate("[% today_due_date_and_time | $KohaDates dateformat => 'iso', with_hours => 1 %]"); >- } else { >- duedatespec_fp.setDate(""); >+ const duedatespec = document.querySelector("#duedatespec"); >+ if( duedatespec ){ >+ const duedatespec_fp = duedatespec._flatpickr; >+ if ( $("#onsite_checkout").prop('checked') ) { >+ duedatespec_fp.setDate("[% today_due_date_and_time | $KohaDates dateformat => 'iso', with_hours => 1 %]"); >+ } else { >+ duedatespec_fp.setDate(""); >+ } > } > } > >-- >2.34.1
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 36494
:
164286
|
164440
| 164734