Bug 37327 - JS crash on patrons list when there is patron with empty name
Summary: JS crash on patrons list when there is patron with empty name
Status: RESOLVED DUPLICATE of bug 37368
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-11 13:58 UTC by Peter Vashchuk
Modified: 2024-07-18 16:32 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 37327: JS crash on patrons list when there is patron with empty name (1.36 KB, patch)
2024-07-11 14:30 UTC, Peter Vashchuk
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Vashchuk 2024-07-11 13:58:57 UTC
When a patron has an empty first name and surname, JS crashes on the patrons list page, causing the patron list to fail to load.

To reproduce:
1. Create a new or edit existing patron and set the "First Name" as empty and "Surname" as whitespace (' '), so both name and surname are empty.
2. Go to the patron search page and search to load the patron list, which will lead to JS crash and patron list not loading.
3. The error can be found in the console of your browser "Uncaught TypeError: Cannot read properties of undefined (reading 'name')"
Comment 1 Peter Vashchuk 2024-07-11 14:29:18 UTC
Patch that I will post below is a hotfix that we implemented on our production to somehow fix the issue but we did not do deep enough research to figure out if this is the right way to go about it and maybe it would be better to instead populate patron.library.name.
Comment 2 Peter Vashchuk 2024-07-11 14:30:37 UTC
Created attachment 168830 [details] [review]
Bug 37327: JS crash on patrons list when there is patron with empty name

To reproduce:
1. Create a new or edit existing patron and set the "First Name" as empty and "Surname" as whitespace (' '), so both name and surname are empty.
2. Go to the patron search page and do the search to load the patron list, which will lead to JS crash and patron list not loading.
3. Apply the patch.
4. Do step 2 again, this time the patron list should load properly.
Comment 3 Katrin Fischer 2024-07-18 16:32:52 UTC
It looks like this is duplicate to bug 37368 that is a more complete fix.

*** This bug has been marked as a duplicate of bug 37368 ***