Bug 31192

Summary: Checking in an unkown barcode causes error
Product: Koha Reporter: Nick Clemens <nick>
Component: CirculationAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, lucas, martin.renvoize, sally.healey
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on: 28854    
Bug Blocks:    
Attachments: Bug 31192: Check for item before calling is_bundle
Bug 31192: Check for item before calling is_bundle
Bug 31192: Check for item before calling is_bundle

Description Nick Clemens 2022-07-19 19:40:01 UTC
Can't call method "is_bundle" on an undefined value at /kohadevbox/koha/circ/returns.pl line 413
Comment 1 Martin Renvoize 2022-07-20 08:31:10 UTC
Created attachment 137896 [details] [review]
Bug 31192: Check for item before calling is_bundle

The code in here is weird.. we really aught to check for the item before
anything else and throw an error to screen if we don't find one... but
my patch takes the simple option, and the one taken elsewhere in the
script.. to just check for item being defined before calling a method
upon it.
Comment 2 Biblibre Sandboxes 2022-07-20 08:48:40 UTC
Created attachment 137903 [details] [review]
Bug 31192: Check for item before calling is_bundle

The code in here is weird.. we really aught to check for the item before
anything else and throw an error to screen if we don't find one... but
my patch takes the simple option, and the one taken elsewhere in the
script.. to just check for item being defined before calling a method
upon it.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 3 Sally 2022-07-20 08:50:40 UTC
The patch fixes the reported problem, signing off.  Thanks for the patch.
Comment 4 Nick Clemens 2022-07-20 14:16:43 UTC
Created attachment 137926 [details] [review]
Bug 31192: Check for item before calling is_bundle

The code in here is weird.. we really aught to check for the item before
anything else and throw an error to screen if we don't find one... but
my patch takes the simple option, and the one taken elsewhere in the
script.. to just check for item being defined before calling a method
upon it.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi 2022-07-20 14:54:44 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Lucas Gass 2022-08-23 20:09:28 UTC
Missing dependencies for 22.05.x, no backport