Bugzilla – Attachment 120340 Details for
Bug 28254
Make it possible to override rules in PUT /holds/:hold_id/pickup_location
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28254: (QA follow-up) override -> force
Bug-28254-QA-follow-up-override---force.patch (text/plain), 2.85 KB, created by
Martin Renvoize (ashimema)
on 2021-04-30 13:44:05 UTC
(
hide
)
Description:
Bug 28254: (QA follow-up) override -> force
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-04-30 13:44:05 UTC
Size:
2.85 KB
patch
obsolete
>From 640c93443ccc0d1d15e96f08df3f4d905d68cc67 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 30 Apr 2021 14:41:43 +0100 >Subject: [PATCH] Bug 28254: (QA follow-up) override -> force > >After some discussion we decided that the parameter should be called >'force' for pushign through an action against policy. (as per the >Transfers work). > >We decided to stick to 'override' at the API level however as it >highlights the 'human interaction' element of the call. >--- > Koha/Hold.pm | 6 +++--- > Koha/REST/V1/Holds.pm | 2 +- > t/db_dependent/Koha/Hold.t | 4 ++-- > 3 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 793b4983bc..2bdae269ec 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -257,7 +257,7 @@ sub is_pickup_location_valid { > $hold->set_pickup_location( > { > library_id => $library->id, >- [ override => 0|1 ] >+ [ force => 0|1 ] > } > ); > >@@ -265,7 +265,7 @@ Updates the hold pickup location. It throws a I<Koha::Exceptions::Hold::InvalidP > the passed pickup location is not valid. > > Note: It is up to the caller to verify if I<AllowHoldPolicyOverride> is set when setting the >-B<override> parameter. >+B<force> parameter. > > =cut > >@@ -276,7 +276,7 @@ sub set_pickup_location { > unless $params->{library_id}; > > if ( >- $params->{override} >+ $params->{force} > || $self->is_pickup_location_valid( > { library_id => $params->{library_id} } > ) >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index bea108f5d0..b6545b1997 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -539,7 +539,7 @@ sub update_pickup_location { > $hold->set_pickup_location( > { > library_id => $pickup_library_id, >- override => $can_override >+ force => $can_override > } > ); > >diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t >index 736b32b305..5f6a9016c8 100755 >--- a/t/db_dependent/Koha/Hold.t >+++ b/t/db_dependent/Koha/Hold.t >@@ -125,9 +125,9 @@ subtest 'set_pickup_location() tests' => sub { > $item_hold->discard_changes; > is( $item_hold->branchcode, $library_3->branchcode, 'branchcode remains untouched' ); > >- $item_hold->set_pickup_location({ library_id => $library_1->branchcode, override => 1 }); >+ $item_hold->set_pickup_location({ library_id => $library_1->branchcode, force => 1 }); > $item_hold->discard_changes; >- is( $item_hold->branchcode, $library_1->branchcode, 'branchcode changed because of \'override\'' ); >+ is( $item_hold->branchcode, $library_1->branchcode, 'branchcode changed because of \'force\'' ); > > $ret = $item_hold->set_pickup_location({ library_id => $library_2->id }); > is( ref($ret), 'Koha::Hold', 'self is returned' ); >-- >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 28254
:
120281
|
120282
|
120283
|
120305
|
120306
|
120307
|
120337
|
120338
|
120339
| 120340 |
120457
|
120458