Bug 34068: Fix pagination for hold pickup locations

This patch addresses an issue where pagination filters are set incorrectly for the pickup locations endpoint. Only the final page is returned rather than the expected full list of results

Test plan:
1) In KTD, set the syspref RESTdefaultPageSize to 5
2) Set AllowHoldPolicyOverride to Allow
3) Create a hold on an item for a patron
4) Navigate to the patron's page and click on the holds tab
5) Click the dropdown in pickup locations
6) There will be two results, repeated three times
7) Apply patch and restart_all
8) Repeat step 5, there should now be a full list of 12 libraries

Co-authored-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Matt Blenkinsop 2024-09-26 12:39:58 +00:00 committed by Katrin Fischer
parent 3bd4a9fad6
commit 37f85baed4
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 3 additions and 1 deletions

View File

@ -462,11 +462,12 @@ sub pickup_locations {
$ps_set = $hold->biblio->pickup_locations( { patron => $hold->patron } );
}
my $pickup_locations = $c->objects->search( $ps_set );
my $pickup_locations;
my @response = ();
if ( C4::Context->preference('AllowHoldPolicyOverride') ) {
$pickup_locations = $ps_set->as_list;
my $libraries_rs = Koha::Libraries->search( { pickup_location => 1 } );
my $libraries = $c->objects->search($libraries_rs);
@ -487,6 +488,7 @@ sub pickup_locations {
);
}
$pickup_locations = $c->objects->search( $ps_set );
@response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations};
return $c->render(