Bug 14842

Summary: Wrong call to GetBranchItemRule in circ/returns.pl
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: CirculationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, tomascohen
Version: Main   
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:
Circulation function:
Bug Depends on: 7981    
Bug Blocks:    
Attachments: Bug 14842: Wrong call to GetBranchItemRule
Bug 14842: Wrong call to GetBranchItemRule
[PASSED QA] Bug 14842: Wrong call to GetBranchItemRule

Description Jonathan Druart 2015-09-17 08:06:31 UTC
From bug 7981:

circ/returns.pl around l. 276

my $hbr = GetBranchItemRule($biblio->{'homebranch'}, $itemtype)->{'returnbranch'} || "homebranch";

GetBranchItemRule expects an itemtype, a scalar.
Here $itemtype is a hashref returned by C4::ItemType->get.

This must be blocker for the next release.
Comment 1 Jonathan Druart 2015-09-17 08:07:59 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2015-09-23 11:47:34 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2015-09-29 21:31:09 UTC
Hi Jonathan or Marcel - can you please add a test plan to this?
Comment 4 Jonathan Druart 2015-10-01 11:09:04 UTC
If I remember correctly you must use an itemtype with a return policy.
Whatever the value of the policy, the return branch will always be the homebranch.
Comment 5 Katrin Fischer 2015-10-01 21:04:19 UTC
Created attachment 43035 [details] [review]
[PASSED QA] Bug 14842: Wrong call to GetBranchItemRule

From bug 7981:

GetBranchItemRule expects an itemtype, a scalar.
Here $itemtype is a hashref returned by C4::ItemType->get.
So $itemtype->{itemtype} should be passed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Tomás Cohen Arazi (tcohen) 2015-10-02 15:11:09 UTC
Patch pushed to master.

Thanks Jonathan!