https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31143

--- Comment #75 from Jonathan Druart <[email protected]> ---
(In reply to Katrin Fischer from comment #74)
> 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 watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to