[Bug 36494] New: Flatpickr error on checkout pages if the patron is blocked from checking out
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Bug ID: 36494 Summary: Flatpickr error on checkout pages if the patron is blocked from checking out Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Circulation Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com, testopia@bugs.koha-community.org Depends on: 18885 The change made by Bug 18885 can fail if the patron is restricted or expired. In that situation, the #duedatespec input doesn't exist, and trying to apply a Flatpickr configuration to it causes an error in the console: Uncaught TypeError: can't access property "_flatpickr", document.querySelector(...) is null Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18885 [Bug 18885] When 'on-site checkout' was used, the 'Specify due date' should be emptied for next checkout unless OnSiteCheckoutAutoCheck -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Flatpickr error on checkout |Flatpickr error on checkout |pages if the patron is |page if the patron is |blocked from checking out |blocked from checking out -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- The problem can also be seen if the SpecifyDueDate preference is disabled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 164286 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164286&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164286|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 164440 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164440&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #4 from David Nind <david@davidnind.com> --- Testing notes: 1. I could also generate the console errors by going to Circulation > Check out[1] 2. I also encounter thus error, but maybe not related to this bug(?) - this was only in Chrome-based browsers, not Firefox: . Patch applied . Add a restriction to a patron ([any patron] > Check out > Restrictions tab (for the comment, add the text 'Test') . Remove the restriction . Add a restriction again, this time use the 'autocomplete'/prompt that comes up with previously entered values for comment field and select 'Test' again . I get this error (I couldn't always reproduce it): shortcut_23.1200015.js:46 Uncaught ReferenceError: code is not defined at HTMLDocument.func (shortcut_23.1200015.js:46:49) [1] Console errors displayed in Ciruclation > Check out: jQuery.Deferred exception: Cannot read properties of null (reading '_flatpickr') TypeError: Cannot read properties of null (reading '_flatpickr') at toggle_onsite_checkout (http://127.0.0.1:8081/cgi-bin/koha/circ/circulation.pl:1923:74) at HTMLDocument.<anonymous> (http://127.0.0.1:8081/cgi-bin/koha/circ/circulation.pl:1955:13) at e (http://127.0.0.1:8081/intranet-tmpl/lib/jquery/jquery-3.6.0.min_23.1200015.j...) at t (http://127.0.0.1:8081/intranet-tmpl/lib/jquery/jquery-3.6.0.min_23.1200015.j...) undefined Uncaught TypeError: Cannot read properties of null (reading '_flatpickr') at toggle_onsite_checkout (circulation.pl:1923:74) at HTMLDocument.<anonymous> (circulation.pl:1955:13) at e (jquery-3.6.0.min_23.1200015.js:2:30038) at t (jquery-3.6.0.min_23.1200015.js:2:30340) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #164440|0 |1 is obsolete| | --- Comment #5 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Created attachment 164734 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164734&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |emily.lamancusa@montgomeryc |y.org |ountymd.gov CC| |emily.lamancusa@montgomeryc | |ountymd.gov Status|Signed Off |Passed QA --- Comment #6 from Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> --- Nice catch! Passing QA It looks like the error David found is unrelated and comes from our keydown event handling in shortcut.js...we check both e.keyCode and e.which to determine which key was pressed, but (according to a bit of googling) they don't play nice with special keys. They're also both deprecated D: (though it looks like no one has dropped support for them yet) Filing bug bug 36580 to put it on the radar. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Pushed to stable Version(s)|24.05.00 |24.05.00,23.11.06 released in| | --- Comment #8 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 23.11.x for 23.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |36459 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36459 [Bug 36459] Backdating checkouts on circ/circulation.pl not working properly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Bug 36494 depends on bug 18885, which changed state. Bug 18885 Summary: When 'on-site checkout' was used, the 'Specify due date' should be emptied for next checkout unless OnSiteCheckoutAutoCheck https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18885 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36494 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz Status|Pushed to oldstable |Needs documenting --- Comment #9 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org