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)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 5 May 2014 17:17:36 +0000 (17:17 +0000)
commit7acd7f43a703c3aa853ea6e58153584c24ca6d09
treef1913669ffa1b47ce3e53acbbeeb1be67d912d4c
parent2afadcc3583c466759f2c4da6970a3cc96a1ba36
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>
C4/Reserves.pm