[Koha-bugs] [Bug 31395] Checking in non-existent barcodes makes Koha explode

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Aug 18 19:19:39 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31395

--- Comment #1 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 139407
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139407&action=edit
Bug 31395: Only try to cancel holds if item found

This patch makes the code dealing with waiting holds with cancellation
requests be dependent on the fact an item has been found.

The returns.pl controller is a bit messy as the real return takes place
outside the main `if ($item)` block. This should be refactored and
probably run inside a transaction...

In the meantime this patch will make the job.

To test:
1. Try to return an invalid barcode (e.g. ASDQWE)
=> FAIL: Things explode
2. Apply this patch
3. Repeat 1
=> SUCCESS: Doesn't explode!
4. Verify that returning an item with a waiting hold with cancellation
   requests still cancells the hold.
=> SUCCESS: It does!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list