Bugzilla – Attachment 118815 Details for
Bug 26999
"Any library" not translatable on the hold list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26999: (follow-up) Simplify code
Bug-26999-follow-up-Simplify-code.patch (text/plain), 2.32 KB, created by
Martin Renvoize (ashimema)
on 2021-03-25 14:39:46 UTC
(
hide
)
Description:
Bug 26999: (follow-up) Simplify code
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-03-25 14:39:46 UTC
Size:
2.32 KB
patch
obsolete
>From fc1688500b0ea051d05d58b0416a32e058168129 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 15 Mar 2021 08:33:49 -0300 >Subject: [PATCH] Bug 26999: (follow-up) Simplify code > >Doing >$ git grep pickup_locations_code > >shows there's some calculated data that is not actually used anywhere. >We can get rid of it. > >This patch also reuses $item_object (which is in the same loop scope) to >avoid an extra DB call. > >To test: >1. Run: > $ git grep pickup_locations_code >=> FAIL: It is only used/set as a comma separated string, inside >request.pl >2. Apply this patch >3. Repeat 1 >=> SUCCESS: The unused stuff is not there anymore >4. Open the page for placing some holds >=> SUCCESS: It doesn't explode >5. Sign off :-D > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > reserve/request.pl | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > >diff --git a/reserve/request.pl b/reserve/request.pl >index 24255e8f5d..dffe1da436 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -568,16 +568,15 @@ foreach my $biblionumber (@biblionumbers) { > { > $item->{available} = 1; > $num_available++; >- if($branchitemrule->{'hold_fulfillment_policy'} eq 'any' ) { >+ >+ if ( $branchitemrule->{'hold_fulfillment_policy'} eq 'any' ) >+ { > $item->{any_pickup_location} = 1; >- } else { >- my $arr_locations = Koha::Items->find($itemnumber) >- ->pickup_locations( { patron => $patron } )->as_list(); >+ } >+ else { >+ my @pickup_locations = $item_object->pickup_locations({ patron => $patron }); > >- $item->{pickup_locations} = join( ', ', >- map { $_->unblessed->{branchname} } @$arr_locations); >- $item->{pickup_locations_code} = join( ',', >- map { $_->unblessed->{branchcode} } @$arr_locations); >+ $item->{pickup_locations} = join( ', ', map { $_->branchname } @pickup_locations ); > } > > push( @available_itemtypes, $item->{itype} ); >-- >2.20.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 26999
:
118228
|
118230
|
118233
|
118234
|
118814
| 118815