Bugzilla – Attachment 114512 Details for
Bug 27205
Hold routes are not dealing with invalid pickup locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27205: Improve logic readability in conditional
Bug-27205-Improve-logic-readability-in-conditional.patch (text/plain), 1.39 KB, created by
Jonathan Druart
on 2020-12-18 10:56:54 UTC
(
hide
)
Description:
Bug 27205: Improve logic readability in conditional
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-12-18 10:56:54 UTC
Size:
1.39 KB
patch
obsolete
>From 228062f824e319f35f363e84efa2930c84973908 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 18 Dec 2020 11:56:22 +0100 >Subject: [PATCH] Bug 27205: Improve logic readability in conditional > >--- > Koha/REST/V1/Holds.pm | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index 27f20996ce..9e230fe4d0 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -257,11 +257,9 @@ sub edit { > > my $pickup_library_id = $body->{pickup_library_id}; > >- unless ( >- !defined $pickup_library_id >- or $hold->is_pickup_location_valid( >- { library_id => $pickup_library_id } >- ) >+ if ( >+ defined $pickup_library_id >+ and not $hold->is_pickup_location_valid({ library_id => $pickup_library_id }) > ) > { > return $c->render( >@@ -272,8 +270,7 @@ sub edit { > ); > } > >- $pickup_library_id = $hold->branchcode >- unless defined $pickup_library_id; >+ $pickup_library_id //= $hold->branchcode; > my $priority = $body->{priority} // $hold->priority; > # suspended_until can also be set to undef > my $suspended_until = exists $body->{suspended_until} ? $body->{suspended_until} : $hold->suspend_until; >-- >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 27205
:
114358
|
114375
|
114377
|
114382
|
114384
|
114446
|
114447
| 114512