Bugzilla – Attachment 163199 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.67 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-03-15 11:03:25 UTC
(
hide
)
Description:
Bug 36277: Do not fetch the whole library list
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-03-15 11:03:25 UTC
Size:
1.67 KB
patch
obsolete
>From f81d53f1c1e986486761db6437f7ef7249f20a17 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 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > 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.44.0
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