[Bug 38254] New: Patron auto-complete search explodes when dateexpiry is NULL
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Bug ID: 38254 Summary: Patron auto-complete search explodes when dateexpiry is NULL Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com This was moved from bug 31143:
We either need to fix the auto-complete patron search or have the script re-calculate the dateexpiry from the patron category. I am leaning towards making the patron search deal with NULL.
borrowers.dateexpiry can be NULL so the code needs to be fixed. I have not tried it but this would be the idea: iff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 73a4a0251e1..28060fb35da 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -694,10 +694,13 @@ function patron_autocomplete(node, options) { } let new_date = new Date(); let today = Date.parse($date_to_rfc3339($date(new_date.toString()))); - let expiration = Date.parse( - $date_to_rfc3339($date(item.expiry_date.toString())) - ); - let expired = today > expiration; + let expired = false; + if (item.expiry_date){ + let expiration = Date.parse( + $date_to_rfc3339($date(item.expiry_date.toString())) + ); + expired = today > expiration; + } return $("<li></li>") .addClass(loggedInClass) .data("ui-autocomplete-item", item) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31143 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@ptfs-europe.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_24_11_candidate -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 --- Comment #1 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 174632 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174632&action=edit Bug 38254: Treat NULL dateexpity as not expired in patron autocomplete To test: 1. Add some NULL patron dateexpiry dates. 2. Make sure PatronAutoComplete is on. 3. Try searching for some patrons with NULL patron dateexpiry dates. 4. Search doesn't complete, see JS error in console. 5. APPLY PATCH and try again 6. Now NULL dateexpiry patrons should be returned in the autocomplete. 7. Make sure patrons with dateexpiry in past still show the 'Expired' badge. 8. Patrons with a dateexpiry in the future or a NULL dateexpiry should not shhow the 'Expired' badge. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_24_05_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 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=38254 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #174632|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 174633 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174633&action=edit Bug 38254: Treat NULL dateexpity as not expired in patron autocomplete To test: 1. Add some NULL patron dateexpiry dates. 2. Make sure PatronAutoComplete is on. 3. Try searching for some patrons with NULL patron dateexpiry dates. 4. Search doesn't complete, see JS error in console. 5. APPLY PATCH and try again 6. Now NULL dateexpiry patrons should be returned in the autocomplete. 7. Make sure patrons with dateexpiry in past still show the 'Expired' badge. 8. Patrons with a dateexpiry in the future or a NULL dateexpiry should not shhow the 'Expired' badge. 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=38254 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This fixes patron release notes| |autocomplete searching so | |that it continues to work | |if there are patron | |accounts without an account | |expiry date, instead of | |failing. This could happen | |because of incorrect data, | |including from migration or | |previous upgrades - Koha | |now expects a date, where | |it may not have in the | |past. --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. For step 1, I used this SQL query to update the expiry date for Mary to NULL: update borrowers set dateexpiry=NULL where borrowernumber=49; 2. PatronAutoComplete is already set to "Try" in KTD. 3. To see the 'Expired' badge, edit Mary's acccount so that 'Expiry date' is blank, then do a search in the search bar at the top. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #174633|0 |1 is obsolete| | --- Comment #4 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 174653 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=174653&action=edit Bug 38254: Treat NULL dateexpiry as not expired in patron autocomplete To test: 1. Add some NULL patron dateexpiry dates. 2. Make sure PatronAutoComplete is on. 3. Try searching for some patrons with NULL patron dateexpiry dates. 4. Search doesn't complete, see JS error in console. 5. APPLY PATCH and try again 6. Now NULL dateexpiry patrons should be returned in the autocomplete. 7. Make sure patrons with dateexpiry in past still show the 'Expired' badge. 8. Patrons with a dateexpiry in the future or a NULL dateexpiry should not shhow the 'Expired' badge. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz QA Contact|testopia@bugs.koha-communit |aleisha@catalyst.net.nz |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com Status|Passed QA |In Discussion --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- Don't push, wait a bit. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- I don't understand why you would need this in 24.05, it's caused by bug 36454 only in main. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |36454 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36454 [Bug 36454] Provide indication if a patron is expired or restricted on patron search autocomplete -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Waiting to push this as we have some ongoing work on the same code on bug 36454. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |RESOLVED Resolution|--- |FIXED --- Comment #8 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Katrin Fischer from comment #7)
Waiting to push this as we have some ongoing work on the same code on bug 36454.
The follow-up from bug 36454: https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=36454&attachment=174671 Fixes/prevents the issue described here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Pedro Amorim from comment #8)
(In reply to Katrin Fischer from comment #7)
Waiting to push this as we have some ongoing work on the same code on bug 36454.
The follow-up from bug 36454: https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter. html&bug=36454&attachment=174671
Fixes/prevents the issue described here.
Thanks Pedro! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_24_05_candidate, | |rel_24_11_candidate, | |RM_priority | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38254 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |DUPLICATE --- Comment #10 from Jonathan Druart <jonathan.druart@gmail.com> --- Changing status as it's not pushed. *** This bug has been marked as a duplicate of bug 36454 *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org