Bug 9532: fix reservability check when bib-level item types are in use
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Fri, 1 Feb 2013 16:52:11 +0000 (17:52 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 4 Jun 2014 07:38:04 +0000 (09:38 +0200)
commit0578b090956f606a5d978f1343b24600f8b1345e
tree065e31545ceee7aef93e400774c00dd8dc364957
parent4cc6eb8e87c89f840dec572af8ca9bd938699e89
Bug 9532: fix reservability check when bib-level item types are in use

When itemtype is defined on biblio (item-level_itypes syspref), the
method C4::Reserves::CanItemBeReserved uses item->{itemtype}. But
ithe item comes from C4::Items::GetItem and it does not have an
'itemtype' key; in this method the item type value is always in
'itype' key.

This patch corrects it.

Test plan:

You should have itemtype on biblio and 'item-level_itypes' syspref
set to biblio.

This test plan is with ReservesControlBranch on ItemHomeLibrary.
- Choose a branch, a borrower category and an item type, for example
  'NYC', 'CHILD' and 'DVD'
- Set an issuing rule for 'NYC', CHILD' and 'DVD' with 'Holds allowed'
  set to 10
- Set an issuing rule for 'NYC', CHILD' and all item types with
  'Holds allowed' set to 0
- Choose an item of a biblio with itemtype 'DVD', that can be reserved,
  with 'NYC' as homebranch
- Choose a borrower with category 'CHILD'
- Try to request the item for the borrower
=> without the patch, you can
=> with the patch, you can't
You may check reserve is allowed with 'Holds allowed' > 0 on issuing
rule for 'DVD'.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Great test plan - thanks!

Confirmed the bug, and the fix. Looks good to me.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7acd7f43a703c3aa853ea6e58153584c24ca6d09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Reserves.pm