Bugzilla – Attachment 174072 Details for
Bug 34068
Dropdown selector when changing pickup library should not depend on RESTdefaultPageSize
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34068: Fix tests
Bug-34068-Fix-tests.patch (text/plain), 1.94 KB, created by
Jonathan Druart
on 2024-11-06 11:00:26 UTC
(
hide
)
Description:
Bug 34068: Fix tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-06 11:00:26 UTC
Size:
1.94 KB
patch
obsolete
>From a047cfc7c63999881f99a491aa732628f1d421f3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 6 Nov 2024 11:57:42 +0100 >Subject: [PATCH] Bug 34068: Fix tests > >Several wrong things in the previous attempt: >* as_list returns an array >* as_list returns objects, ->{library_id} does not exist >* as_list does not returns api object, you need to call ->branchcode to > get the id >* $pickup_locations defined for both situations was confusing >--- > Koha/REST/V1/Holds.pm | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index c703aba0b53..121e68313e4 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -462,20 +462,18 @@ sub pickup_locations { > $ps_set = $hold->biblio->pickup_locations( { patron => $hold->patron } ); > } > >- 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); > > @response = map { > my $library = $_; > $library->{needs_override} = ( >- any { $_->{library_id} eq $library->{library_id} } >- @{$pickup_locations} >+ any { $_->branchcode eq $library->{library_id} } >+ $ps_set->as_list > ) > ? Mojo::JSON->false > : Mojo::JSON->true; >@@ -488,7 +486,7 @@ sub pickup_locations { > ); > } > >- $pickup_locations = $c->objects->search( $ps_set ); >+ my $pickup_locations = $c->objects->search( $ps_set ); > @response = map { $_->{needs_override} = Mojo::JSON->false; $_; } @{$pickup_locations}; > > return $c->render( >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34068
:
152486
|
171964
|
171969
|
171970
|
174071
|
174072
|
174106
|
176110
|
176111
|
176112
|
176113
|
176331
|
176332
|
176333
|
176334