@@ -, +, @@ --- Koha/REST/V1/Items.pm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/Koha/REST/V1/Items.pm +++ a/Koha/REST/V1/Items.pm @@ -115,19 +115,21 @@ sub pickup_locations { my $ps_set = $item->pickup_locations( { patron => $patron } ); - my $pickup_locations = $c->objects->search( $ps_set ); my @response = (); - if ( C4::Context->preference('AllowHoldPolicyOverride') ) { my $libraries_rs = Koha::Libraries->search( { pickup_location => 1 } ); my $libraries = $c->objects->search($libraries_rs); + return $c->render( + status => 200, + openapi => $libraries + ); @response = map { my $library = $_; $library->{needs_override} = ( any { $_->{library_id} eq $library->{library_id} } - @{$pickup_locations} + @{$ps_set} ) ? Mojo::JSON->false : Mojo::JSON->true; @@ -140,6 +142,8 @@ sub pickup_locations { ); } + my $pickup_locations = $c->objects->search( $ps_set ); + @response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations}; return $c->render( --