Bugzilla – Attachment 174633 Details for
Bug 38254
Patron auto-complete search explodes when dateexpiry is NULL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38254: Treat NULL dateexpity as not expired in patron autocomplete
Bug-38254-Treat-NULL-dateexpity-as-not-expired-in-.patch (text/plain), 1.91 KB, created by
David Nind
on 2024-11-15 19:48:43 UTC
(
hide
)
Description:
Bug 38254: Treat NULL dateexpity as not expired in patron autocomplete
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-11-15 19:48:43 UTC
Size:
1.91 KB
patch
obsolete
>From b16f45c0b4917eda3fc424abec3ffc451e0d162a Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 15 Nov 2024 17:15:57 +0000 >Subject: [PATCH] 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> >--- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index e993f8fe01..d6e6ece3cf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -697,10 +697,12 @@ 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; >+ if ( item.expiry_date ) { >+ let expiration = Date.parse($date_to_rfc3339($date(item.expiry_date.toString()))); >+ } else { >+ expiration = 0; >+ } >+ let expired = item.expiry_date ? today > Date.parse($date_to_rfc3339($date(item.expiry_date.toString()))) : false; > return $("<li></li>") > .addClass(loggedInClass) > .data("ui-autocomplete-item", item) >-- >2.39.5
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 38254
:
174632
|
174633
|
174653