Bug 34256 - Patron search: search for borrowernumber starts with fails
Summary: Patron search: search for borrowernumber starts with fails
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Pedro Amorim
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 34092
Blocks: 29822
  Show dependency treegraph
 
Reported: 2023-07-11 21:47 UTC by Katrin Fischer
Modified: 2023-09-13 20:34 UTC (History)
5 users (show)

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


Attachments
34256: Fix regression from 34092 (1.63 KB, patch)
2023-07-14 08:37 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 34256: Fix regression from 34092 (1.94 KB, patch)
2023-07-14 09:09 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-07-11 21:47:42 UTC
The sample data has patrons with borrowernumbers 51 and 19. Neither is found when you select borrowernumber and starts with in the search filters.

I am sure this was a regression on one point, because I have used this feature before.
Comment 1 Andreas Roussos 2023-07-14 07:58:15 UTC
(In reply to Katrin Fischer from comment #0)
> The sample data has patrons with borrowernumbers 51 and 19. Neither is found
> when you select borrowernumber and starts with in the search filters.
I can reproduce this on the current master, too.

> I am sure this was a regression on one point, because I have used this
> feature before.
The relevant commit is a9f8db17fe from Bug 34092 ("Move search-patron.inc
logic into buildPatronSearchQuery"). See also Bug 34067.
Comment 2 Pedro Amorim 2023-07-14 08:37:48 UTC
Created attachment 153441 [details] [review]
34256: Fix regression from 34092

It appears search_fields variable got lost somewhere in my own rebases. search_fields variable was not being considered as it should, in the function. I think this patch fixes it.
Comment 3 Katrin Fischer 2023-07-14 09:09:18 UTC
Created attachment 153448 [details] [review]
Bug 34256: Fix regression from 34092

It appears search_fields variable got lost somewhere in my own rebases.
search_fields variable was not being considered as it should, in the function.
I think this patch fixes it.

This showed in the borrowernumer no longer being searchable:

* Use search filters in patron search
* Set 'Search field' to borrowernumber
* Search for 19 (Henry) or 41 (koha) in sample data
* No results :(
* Apply patch
* Search leads to the patron record again

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 4 Katrin Fischer 2023-07-14 09:09:56 UTC
I'll treat this as a QA follow-up for bug 34092.
Comment 5 Pedro Amorim 2023-07-14 09:52:03 UTC
(In reply to Katrin Fischer from comment #4)
> I'll treat this as a QA follow-up for bug 34092.

Thanks Katrin, that makes sense, it's exactly what this is!
And thanks for spotting this bug.
Comment 6 Tomás Cohen Arazi 2023-07-14 18:24:31 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Martin Renvoize 2023-07-18 11:52:41 UTC
Thanks for all the hard work!

Pushed to 23.05.x for the next release
Comment 8 Matt Blenkinsop 2023-07-18 15:29:15 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x