Bugzilla – Attachment 163134 Details for
Bug 36277
t/db_dependent/api/v1/transfer_limits.t is failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36277: Do not fetch the whole library list
Bug-36277-Do-not-fetch-the-whole-library-list.patch (text/plain), 1.56 KB, created by
Jonathan Druart
on 2024-03-14 13:42:44 UTC
(
hide
)
Description:
Bug 36277: Do not fetch the whole library list
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-03-14 13:42:44 UTC
Size:
1.56 KB
patch
obsolete
>From dbf4c83f83aeb81281512a8b590a0ce7f98f525c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 14 Mar 2024 14:06:28 +0100 >Subject: [PATCH] Bug 36277: Do not fetch the whole library list > >--- > Koha/REST/V1/TransferLimits.pm | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/V1/TransferLimits.pm b/Koha/REST/V1/TransferLimits.pm >index 0d7b0eb4727..83fa6c568d4 100644 >--- a/Koha/REST/V1/TransferLimits.pm >+++ b/Koha/REST/V1/TransferLimits.pm >@@ -128,10 +128,18 @@ sub batch_add { > return try { > my $params = $c->req->json; > >- my @libraries = Koha::Libraries->search->as_list; >- >- my @from_branches = $params->{from_library_id} ? $params->{from_library_id} : map { $_->id } @libraries; >- my @to_branches = $params->{to_library_id} ? $params->{to_library_id} : map { $_->id } @libraries; >+ my ( @from_branches, @to_branches ); >+ if ( $params->{from_library_id} ) { >+ @from_branches = ( $params->{from_library_id} ); >+ } >+ if ( $params->{to_library_id} ) { >+ @to_branches = ( $params->{to_library_id} ); >+ } >+ unless ( $params->{from_library_id} && $params->{to_library_id} ) { >+ my @library_ids = Koha::Libraries->search->get_column('branchcode'); >+ @from_branches = @library_ids unless $params->{from_library_id}; >+ @to_branches = @library_ids unless $params->{to_library_id}; >+ } > > my @results; > foreach my $from ( @from_branches ) { >-- >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 36277
:
163134
|
163135
|
163189
|
163190
|
163199
|
163200
|
163225