[Koha-bugs] [Bug 20985] CanBookBeReserved and CanItemBeReserved should check 'On shelf holds allowed' policy

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 14 01:13:09 CEST 2019


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

--- Comment #6 from Arthur Suzuki <arthur.suzuki at biblibre.com> ---
(In reply to Hayley Mapley from comment #3)
> This patch results in a runtime error. Here are the steps I followed which
> led to the error.
> 
> - Checked default circulation rule - OnShelfHoldsAllowed is set to yes
> - Clicked Place hold on a biblio with one available item
> - Entered card number - error!
> 
> Error trace: 
> 
> Can't call method "effective_itemtype" on an undefined value at
> /home/vagrant/kohaclone/C4/Reserves.pm line 1181
> 
> 1.    in C4::Reserves::IsAvailableForItemLevelRequest at
> /home/vagrant/kohaclone/C4/Reserves.pm line 1181
> 
>      1178:     #         consolidated
>      1179:     my $patron = Koha::Patrons->find( $borrower->{borrowernumber}
> );
>      1180:     my $item_object = Koha::Items->find( $item->{itemnumber } );
>      1181:     my $itemtype = $item_object->effective_itemtype;
>      1182:     my $notforloan_per_itemtype
>      1183:       = $dbh->selectrow_array("SELECT notforloan FROM itemtypes
> WHERE itemtype = ?",
>      1184:                               undef, $itemtype);
> 
> 2.    in C4::Reserves::CanItemBeReserved at
> /home/vagrant/kohaclone/C4/Reserves.pm line 332
> 
>       329:         && !C4::Context->preference('AllowHoldsOnDamagedItems') );
>       330: 
>       331:     # Check for item on shelves and OnShelfHoldsAllowed
>       332:     return { status => 'onShelfHoldsNotAllowed' }
>       333:       unless ( IsAvailableForItemLevelRequest($item,$borrower) );
>       334: 
>       335:     # Check for the age restriction
> 
> 3.    in C4::Reserves::CanBookBeReserved at
> /home/vagrant/kohaclone/C4/Reserves.pm line 286
> 
>       283: 
>       284:     my $canReserve = { status => '' };
>       285:     foreach my $itemnumber (@itemnumbers) {
>       286:         $canReserve = CanItemBeReserved( $borrowernumber,
> $itemnumber, $pickup_branchcode );
>       287:         return { status => 'OK' } if $canReserve->{status} eq
> 'OK';
>       288:     }
>       289:     return $canReserve;
> 
> Setting to Failed QA

Hi Hayley,
Thanks for testing, updated my patch in consequence :)

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


More information about the Koha-bugs mailing list