Bugzilla – Attachment 131190 Details for
Bug 29877
MaxReserves should be enforced consistently between staff interface and API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29877: Make POST /holds handle maxreserves correctly
Bug-29877-Make-POST-holds-handle-maxreserves-corre.patch (text/plain), 1.55 KB, created by
Martin Renvoize
on 2022-03-01 15:17:57 UTC
(
hide
)
Description:
Bug 29877: Make POST /holds handle maxreserves correctly
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-03-01 15:17:57 UTC
Size:
1.55 KB
patch
obsolete
>From b5133607b0abd93f3fa4016e2038a6280fba5ca3 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 13 Jan 2022 12:10:30 -0300 >Subject: [PATCH] Bug 29877: Make POST /holds handle maxreserves correctly > >The current implementation doesn't consider the following values for the >syspref: undef and 0. > >The tests mistakenly didn't cover them. > >To test: >1. Apply the regression tests patch >2. Run: > $ kshell > k$ prove t/db_dependent/api/v1/holds.t >=> FAIL: Tests fail, obvious warnings about comparing undefined values > too. >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. You can try on Postman as well >=> SUCCESS: Behavior is correct! >6. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/V1/Holds.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/REST/V1/Holds.pm b/Koha/REST/V1/Holds.pm >index 142668419e..acd4b78e20 100644 >--- a/Koha/REST/V1/Holds.pm >+++ b/Koha/REST/V1/Holds.pm >@@ -169,7 +169,7 @@ sub add { > ? C4::Reserves::CanItemBeReserved( $patron, $item ) > : C4::Reserves::CanBookBeReserved( $patron_id, $biblio_id ); > >- if ( $patron->holds->count + 1 > C4::Context->preference('maxreserves') ) { >+ if ( C4::Context->preference('maxreserves') && $patron->holds->count + 1 > C4::Context->preference('maxreserves') ) { > $can_place_hold->{status} = 'tooManyReserves'; > } > >-- >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 29877
:
129411
|
129412
|
129415
|
129416
|
131189
| 131190