Bug 30622

Summary: Search for cardnumber needs to go directly to patron record when placing a hold
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: gmcharlt, jonathan.druart, kyle.m.hall, martin.renvoize, tomascohen
Version: MainKeywords: regression
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00
Bug Depends on: 30063    
Bug Blocks:    
Attachments: Bug 30622: Patron search when placing hold should redirect if cardnumber is entered
Bug 30622: Patron search when placing hold should redirect if cardnumber is entered
Bug 30622: Patron search when placing hold should redirect if cardnumber is entered

Description Katrin Fischer 2022-04-26 14:48:00 UTC
When searching for a cardnumber that matches exactly an existing cardnumber, the corresponding patron needs to 'found' directly, without displaying a result list.

To test:
- Place a hold on anything in staff
- Search for 42 or any other existing cardnumber in your database
- Verify the result list is shown instead of selecting the patron
Comment 1 Jonathan Druart 2022-04-27 14:47:09 UTC
Created attachment 134073 [details] [review]
Bug 30622: Patron search when placing hold should redirect if cardnumber is entered

When search a patron for placing a hold, if a cardnumber is entered we
should pick the patron and use it, instead of display the table result.

This was a regression caused by bug 30063.

Test plan:
- Place a hold on anything in staff
- Search for 42 or any other existing cardnumber in your database
Comment 2 Jonathan Druart 2022-04-27 14:47:40 UTC
Should this behaviour be applied to some other patron searches?
Comment 3 Katrin Fischer 2022-04-27 14:49:40 UTC
Can you give an example? I could test if it's a regression with 20.11 or so.

But my first reaction would be yes. 

An exact match on cardnumber or userid should open the patron record directly.
Comment 4 Jonathan Druart 2022-04-27 15:28:23 UTC
(In reply to Katrin Fischer from comment #3)
> Can you give an example? I could test if it's a regression with 20.11 or so.
> 
> But my first reaction would be yes. 
> 
> An exact match on cardnumber or userid should open the patron record
> directly.

An example of what? Of another patron search?
Could be guarantor, user for funds or suggestion, etc.
Comment 5 Katrin Fischer 2022-04-27 15:51:35 UTC
Hi,

I have done some testing on an older (20.11.x) version:

Cardnumbers for testing:
A
A1
A2

1) Patron search: A
A opens directly

2) Acq > User to notify on receive
A shows only one result

Tried something else:
AA
AA2
AA3

AA = 1 result
A = 3 results
So it seems to limit when exact match. But then you need to click the single result.

3) Place hold
Searching for AA selects the user directly.

So it seems the behavior was a little different between searches before, but it should certainly be fixed for place hold.


Note: it only seems to work for cardnumber, not for userid. But I think this is ok, you are more likely to scan the card and expect a direct link than when searching for userid. Also userid might be more likely to be more uniqe. While sequential cardnumbers generated with autoMemberNum could lead to a long list of possible candidates quicky (especially if you started with 1).
Comment 6 David Nind 2022-05-02 01:44:09 UTC
Created attachment 134451 [details] [review]
Bug 30622: Patron search when placing hold should redirect if cardnumber is entered

When search a patron for placing a hold, if a cardnumber is entered we
should pick the patron and use it, instead of display the table result.

This was a regression caused by bug 30063.

Test plan:
- Place a hold on anything in staff
- Search for 42 or any other existing cardnumber in your database

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Katrin Fischer 2022-05-06 07:50:41 UTC
Working on this now.
Comment 8 Katrin Fischer 2022-05-06 07:54:59 UTC
Created attachment 134681 [details] [review]
Bug 30622: Patron search when placing hold should redirect if cardnumber is entered

When search a patron for placing a hold, if a cardnumber is entered we
should pick the patron and use it, instead of display the table result.

This was a regression caused by bug 30063.

Test plan:
- Place a hold on anything in staff
- Search for 42 or any other existing cardnumber in your database

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 9 Fridolin Somers 2022-05-06 20:35:00 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄