Bugzilla – Attachment 183603 Details for
Bug 40254
POST /holds override logic problem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40254: Fix error in overrides check allowing too much
Bug-40254-Fix-error-in-overrides-check-allowing-to.patch (text/plain), 1.75 KB, created by
Martin Renvoize (ashimema)
on 2025-06-27 13:17:27 UTC
(
hide
)
Description:
Bug 40254: Fix error in overrides check allowing too much
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-06-27 13:17:27 UTC
Size:
1.75 KB
patch
obsolete
>From 0409d3ab0d6b5d49ea79dfdb8c8ce1684394e120 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 26 Jun 2025 17:08:11 -0300 >Subject: [PATCH] Bug 40254: Fix error in overrides check allowing too much > >This patch fixes a subtle (yet naive) error making the controller not >care about blocking conditions if they were more than one and the first >one was overridden. > >To test: >1. Apply the regression tests >2. Run: > $ ktd --shell > k$ prove t/db_dependent/api/v1/holds.t >=> FAIL: Tests fail! Some tests expect a 409 (denied for a conflict) but >return a 201! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > Koha/REST/V1/Holds.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index b6c80906e82..33c885774c8 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -163,7 +163,7 @@ sub add { > openapi => { error => 'The supplied pickup location is not valid' } > ) unless $valid_pickup_location; > >- my $can_place_holds = $patron->can_place_holds(); >+ my $can_place_holds = $patron->can_place_holds( { overrides => $overrides } ); > > if ( !$can_place_holds ) { > my $error_code = $can_place_holds->messages->[0]->message; >@@ -173,7 +173,7 @@ sub add { > error => 'Hold cannot be placed. Reason: ' . $error_code, > error_code => $error_code, > } >- ) unless $overrides->{$error_code}; >+ ); > } > > my $can_hold_be_placed = >-- >2.49.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 40254
:
183557
|
183558
|
183560
|
183561
| 183603 |
183604