https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40979 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This comes from a refactoring before item groups btw: my $all_holds = { map { $_->biblionumber => $_ } @{ Koha::Holds->search( { reserve_id => [ values %$holds_biblios_map ] }, { prefetch => [ 'borrowernumber', 'itembib', 'biblio', 'item_group' ], } )->as_list } }; But what does it exactly do? If we have multiple holds on a biblionumber, the map statement effectively discards all holds but one for each biblio in the resulting hash. So the name $all_holds is misleading! How effective is the prefetch here btw? But some lines later, we are doing: my $res_info = $all_holds->{$bibnum}; Note that the reserve we are using here seems to be the first one we found! And we will make further decisions based on only that hold. (When testing, it was the first one. But the code depends on map creating a hash, where the order is not preserved.) Like this test: if ( $res_info->item_group ) { Yeah, it could have an item group. But that test should not be based on one hold. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.