https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18958
--- Comment #46 from Marcel de Rooy <[email protected]> --- This is so horrible. Just checking occurrences of CheckReserves calls. Here we are in Circulation::CanBookBeRenewed. First we call CheckReserves, but then note the $itemholds=search call and repeated calls to CheckReserves in the while(1).. my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber); # This item can fill one or more unfilled reserve, can those unfilled reserves # all be filled by other available items? if ( $resfound && C4::Context->preference('AllowRenewalIfOtherItemsAvailable') ) { my $schema = Koha::Database->new()->schema(); my $item_holds = $schema->resultset('Reserve')->search( { itemnumber => $itemnumber, found => undef } )->count(); if ($item_holds) { # There is an item level hold on this item, no other item can fill the hold $resfound = 1; } else { # Get all other items that could possibly fill reserves my @itemnumbers = $schema->resultset('Item')->search( { biblionumber => $resrec->{biblionumber}, onloan => undef, notforloan => 0, -not => { itemnumber => $itemnumber } }, { columns => 'itemnumber' } )->get_column('itemnumber')->all(); # Get all other reserves that could have been filled by this item my @borrowernumbers; while (1) { my ( $reserve_found, $reserve, undef ) = C4::Reserves::CheckReserves( $itemnumber, undef, undef, \@borrowernumbers ); -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
