Bug 29637

Summary: AutoSwitchPatron is broken since Bug 26352
Product: Koha Reporter: Michael Hafen <michael.hafen>
Component: CirculationAssignee: Michael Hafen <michael.hafen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: andrewfh, david, dcook, fridolin.somers, gmcharlt, jonathan.druart, kyle.m.hall, kyle
Version: MainKeywords: regression, rel_21_11_candidate
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes an issue introduced by bug 26352 in 21.11 that caused the AutoSwitchPatron system preference to no longer work. (When AutoSwitchPatron is enabled and a patron barcode is scanned instead of a book, it automatically redirects to the patron.)
Version(s) released in:
22.05.00,21.11.01
Attachments: Proposed fix
Bug 29637: AutoSwitchPatron should look for card number in the barcode
Bug 29637: AutoSwitchPatron should look for card number in the barcode

Description Michael Hafen 2021-12-03 18:42:40 UTC
Bug 26352 changed the line in circ/circulation.pl that searches for a patron card number in the barcode field from using the $barcode variable to the $findborrower variable.  This breaks AutoSwitchPatron.
Comment 1 Michael Hafen 2021-12-03 18:47:20 UTC
Created attachment 128232 [details] [review]
Proposed fix

Test plan:

1. make sure AutoSwitchPatron system preference is on.
2. get two patron card numbers.
3. enter the first card number to check out to the patron.
4. enter the second card number in the item barcode field.
5. observe that the barcode is not found.

6. apply patch

7. enter the second card number in the item barcode field again.
8. observe that the second patron is loaded to check out to.
Comment 2 David Nind 2021-12-04 02:51:36 UTC
Created attachment 128240 [details] [review]
Bug 29637: AutoSwitchPatron should look for card number in the barcode

Bug 26352 changed the line in circ/circulation.pl that searches for a
patron card number in the barcode field from using the $barcode variable
to the $findborrower variable.  This breaks AutoSwitchPatron.

Test plan:

1. make sure AutoSwitchPatron system preference is on.
2. get two patron card numbers.
3. enter the first card number to check out to the patron.
4. enter the second card number in the item barcode field.
5. observe that the barcode is not found.

6. apply patch

7. enter the second card number in the item barcode field again.
8. observe that the second patron is loaded to check out to.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Jonathan Druart 2021-12-06 12:45:41 UTC
Created attachment 128275 [details] [review]
Bug 29637: AutoSwitchPatron should look for card number in the barcode

Bug 26352 changed the line in circ/circulation.pl that searches for a
patron card number in the barcode field from using the $barcode variable
to the $findborrower variable.  This breaks AutoSwitchPatron.

Test plan:

1. make sure AutoSwitchPatron system preference is on.
2. get two patron card numbers.
3. enter the first card number to check out to the patron.
4. enter the second card number in the item barcode field.
5. observe that the barcode is not found.

6. apply patch

7. enter the second card number in the item barcode field again.
8. observe that the second patron is loaded to check out to.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 David Nind 2021-12-06 18:46:42 UTC
Note that bug 26352 no longer seems to work (unless I set things up wrong) - see my note on the bug.
Comment 5 Fridolin Somers 2021-12-06 23:17:40 UTC
(In reply to David Nind from comment #4)
> Note that bug 26352 no longer seems to work (unless I set things up wrong) -
> see my note on the bug.

I've tested with KitchenSink and pull-request :
https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/pull/17

All good.
Comment 6 David Nind 2021-12-07 01:31:57 UTC
(In reply to Fridolin Somers from comment #5)
> All good.

Excellent!
Comment 7 Fridolin Somers 2021-12-07 20:44:57 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 8 Kyle M Hall 2021-12-10 12:06:18 UTC
Pushed to 21.11.x for 21.11.01
Comment 9 Andrew Fuerste-Henry 2021-12-17 19:33:47 UTC
Missing dependency, not backported to 21.05.x