Bug 38649 - Searching for a patron from additem.pl triggers an issue slip to print
Summary: Searching for a patron from additem.pl triggers an issue slip to print
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Brendan Lawlor
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: additional_work_needed
Depends on: 37407
Blocks:
  Show dependency treegraph
 
Reported: 2024-12-06 17:46 UTC by Brendan Lawlor
Modified: 2025-02-20 20:57 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes an issue when searching for a patron using the check out menu item in the header, when you are on the add or edit item form for a record. It was triggering a blank issue slip for printing. This was caused by a change in Bug 37407 (Fast add/fast cataloging from patron checkout does not checkout item) that affected checking referrer URLs and query strings.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38649: Fix autocheckout for circulation Fast Add only (1.96 KB, patch)
2024-12-06 17:59 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 38649: Fix autocheckout for circulation Fast Add only (2.01 KB, patch)
2024-12-06 20:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 38649: Fix autocheckout for circulation Fast Add only (2.07 KB, patch)
2024-12-17 08:09 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Brendan Lawlor 2024-12-06 17:46:50 UTC
Bug 37407 fixed automatic checkout of items that were fast cataloged from the circulation module.

To reproduce:
1. From anywhere on the additem.pl page where you are adding or editing an item
2. Click on Checkout in the menu bar and enter a patron's barcode
3. When circulation.pl loads it triggers a blank issue slip to be printed

In addition to checking the referrer for the URL domain and path we should also check the query string of the referrer to make sure it was from a circulation fast add. It should include frameworkcode=FA&circborrowernumber
Comment 1 Brendan Lawlor 2024-12-06 17:59:27 UTC
Created attachment 175269 [details] [review]
Bug 38649: Fix autocheckout for circulation Fast Add only

In addition to checking the referrer for the URL domain and path
we should also check the query string of the referrer to make sure
it was from a circulation fast add.

It should include frameworkcode=FA&circborrowernumber

To test:
1. From anywhere on the additem.pl page where you are adding or editing an item
2. Click on Checkout in the menu bar and enter a patron's barcode
3. When circulation.pl loads it triggers a blank issue slip to be printed
4. Apply patch and repeat steps 1-3, no slip is triggered to print
5. Go to Circulation Checkout for a patron and enter a non existing barcode like 1337
6. Click '+ Add record using fast cataloging'
7. Fill in required fields and click 'Add item'
8. Confirm the item is auto checked out
Comment 2 David Nind 2024-12-06 20:50:02 UTC
Created attachment 175275 [details] [review]
Bug 38649: Fix autocheckout for circulation Fast Add only

In addition to checking the referrer for the URL domain and path
we should also check the query string of the referrer to make sure
it was from a circulation fast add.

It should include frameworkcode=FA&circborrowernumber

To test:
1. From anywhere on the additem.pl page where you are adding or editing an item
2. Click on Checkout in the menu bar and enter a patron's barcode
3. When circulation.pl loads it triggers a blank issue slip to be printed
4. Apply patch and repeat steps 1-3, no slip is triggered to print
5. Go to Circulation Checkout for a patron and enter a non existing barcode like 1337
6. Click '+ Add record using fast cataloging'
7. Fill in required fields and click 'Add item'
8. Confirm the item is auto checked out

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-12-06 21:07:03 UTC
Changed assignee 8-).

I've attempted a release note, but not sure that I have got this right - I don't know how to describe it correctly for library staff.
Comment 4 Martin Renvoize (ashimema) 2024-12-17 08:09:03 UTC
Created attachment 175595 [details] [review]
Bug 38649: Fix autocheckout for circulation Fast Add only

In addition to checking the referrer for the URL domain and path
we should also check the query string of the referrer to make sure
it was from a circulation fast add.

It should include frameworkcode=FA&circborrowernumber

To test:
1. From anywhere on the additem.pl page where you are adding or editing an item
2. Click on Checkout in the menu bar and enter a patron's barcode
3. When circulation.pl loads it triggers a blank issue slip to be printed
4. Apply patch and repeat steps 1-3, no slip is triggered to print
5. Go to Circulation Checkout for a patron and enter a non existing barcode like 1337
6. Click '+ Add record using fast cataloging'
7. Fill in required fields and click 'Add item'
8. Confirm the item is auto checked out

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Katrin Fischer 2024-12-23 09:37:54 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 6 Jonathan Druart 2025-02-03 11:44:33 UTC
It produces a JS error:
Uncaught TypeError: document.referrer.split(...)[1] is undefined

On the following page:
http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
Comment 7 Alex Buckley 2025-02-20 20:57:03 UTC
not backporting to 24.05.x unless requested - keyword of additional work needed