Bug 39229 - Search additional unique patron properties on patron quicksearch
Summary: Search additional unique patron properties on patron quicksearch
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: David Gustafsson
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-03 15:52 UTC by David Gustafsson
Modified: 2025-06-24 17:23 UTC (History)
3 users (show)

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


Attachments
Bug 39229: Search unique extended attributes on patron quicksearch (6.27 KB, patch)
2025-03-03 16:08 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Search unique extended attributes on patron quicksearch (7.12 KB, patch)
2025-03-04 18:14 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Search unique extended attributes on patron quicksearch (7.11 KB, patch)
2025-03-05 14:32 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Also try to find patron by borrowernumber (884 bytes, patch)
2025-03-05 14:35 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Search unique extended attributes on patron quicksearch (7.20 KB, patch)
2025-03-05 14:38 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Also try to find patron by borrowernumber (884 bytes, patch)
2025-03-05 14:38 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Search unique extended attributes on patron quicksearch (7.20 KB, patch)
2025-03-05 15:07 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Also try to find patron by borrowernumber (884 bytes, patch)
2025-03-05 15:08 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Also try to find patron by userid (876 bytes, patch)
2025-03-05 16:23 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Search unique extended attributes on patron quicksearch (7.19 KB, patch)
2025-03-05 16:26 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Also try to find patron by userid (868 bytes, patch)
2025-03-05 16:26 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 39229: Also handle the case when performing a patron checkout (2.66 KB, patch)
2025-04-10 13:41 UTC, David Gustafsson
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Gustafsson 2025-03-03 15:52:03 UTC
The patron search can be very slow when the number of patrons becomes sufficiently large. At our we routinely search for social security number for example (which is a unique extended patron attribute), and this could be so much faster if unique attributes where first queried in the same manner as librarycard is in member.pl (when quicksearch is set).
Comment 1 David Gustafsson 2025-03-03 16:08:06 UTC
Created attachment 178892 [details] [review]
Bug 39229: Search unique extended attributes on patron quicksearch
Comment 2 David Gustafsson 2025-03-03 16:09:09 UTC
Forgot to add how to test etc in commit message, will do so tomorrow.
Comment 3 David Gustafsson 2025-03-04 18:14:42 UTC Comment hidden (obsolete)
Comment 4 David Gustafsson 2025-03-04 18:20:11 UTC
I now created a test plan, but it's unfortunately pretty convoluted. If one has access to a koha instance with at least tens of thousands of patrons, preferably more, there would be a clear difference in response time. But if the number is smaller, it is very hard to notice a difference and hard to test. Exiting the script after the unique attributes quicksearch has been performed was the only way I could figure out, but other suggestions are welcome.
Comment 5 David Gustafsson 2025-03-05 14:32:05 UTC Comment hidden (obsolete)
Comment 6 David Gustafsson 2025-03-05 14:35:21 UTC Comment hidden (obsolete)
Comment 7 David Gustafsson 2025-03-05 14:38:11 UTC Comment hidden (obsolete)
Comment 8 David Gustafsson 2025-03-05 14:38:14 UTC Comment hidden (obsolete)
Comment 9 David Gustafsson 2025-03-05 14:41:07 UTC
I also added quicksearch using borrowernumber.
Comment 10 David Gustafsson 2025-03-05 14:42:12 UTC
I also added finding patron by borrowernumber quicksearch and edited the bug name to reflect the change.
Comment 11 David Gustafsson 2025-03-05 15:07:59 UTC Comment hidden (obsolete)
Comment 12 David Gustafsson 2025-03-05 15:08:02 UTC Comment hidden (obsolete)
Comment 13 David Gustafsson 2025-03-05 16:23:27 UTC Comment hidden (obsolete)
Comment 14 David Gustafsson 2025-03-05 16:23:53 UTC
My mistake, should have been userid.
Comment 15 David Gustafsson 2025-03-05 16:26:52 UTC
Created attachment 178996 [details] [review]
Bug 39229: Search unique extended attributes on patron quicksearch

To test:
1) Apply patch
2) Create a unique extended patron attribute, set it to "Searchable" and
   and "Searched by default"
3) Edit a patron and set a value for the created attribute.
4) Enable UniqueExtendedAttributesQuickSearch syspref
5) Edit memebers/member.pl, before "my $searchfieldstype = ..." around line 94,
   write "exit;" and save the file.
6) Perform a search on the patron attribute value
7) A redirect to the patron page should occur
8) Search for something else not matching the attribute
9) You should now recieve a 500 error (since the script exits
   prematurely, and the normal search is never run)
10) Repeat steps 6 to 9 using userid instead of extended
    attribute value

Sponsored-by: Gothenburg University Library
Comment 16 David Gustafsson 2025-03-05 16:26:55 UTC
Created attachment 178997 [details] [review]
Bug 39229: Also try to find patron by userid
Comment 17 David Gustafsson 2025-04-10 13:41:33 UTC
Created attachment 180780 [details] [review]
Bug 39229: Also handle the case when performing a patron checkout
Comment 18 Esther Melander 2025-06-24 17:23:01 UTC
I tested this and got to step 6. Is the quicksearch done in the green tool bar at top? If that is the case, I did not get a redirect to the patron page and received a 500 error. Searches for other terms that were not an attribute also returned a 500 error.

I also did the search from the Patron module using the search form on the left side of the page. I searched for the attribute using the standard parameter.The patron was in the patron search results list. Searching for other terms gave blank results and no 500 error.

I stopped at this point because I wasn't sure if I was following the test plan correctly. I did edit the members/member.pl file as instructed.