Bugzilla – Attachment 157969 Details for
Bug 35167
GET /items* broken if notforloan == 0 and itemtype.notforloan == NULL
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35167: Make 'effective_not_for_loan_status' fallback to 0 if itype has it undef
Bug-35167-Make-effectivenotforloanstatus-fallback-.patch (text/plain), 1.46 KB, created by
Marcel de Rooy
on 2023-10-27 06:15:48 UTC
(
hide
)
Description:
Bug 35167: Make 'effective_not_for_loan_status' fallback to 0 if itype has it undef
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-10-27 06:15:48 UTC
Size:
1.46 KB
patch
obsolete
>From ee59f88c6d0f2fe0d788c3e56fe04b36040d1d61 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 26 Oct 2023 14:58:40 -0300 >Subject: [PATCH] Bug 35167: Make 'effective_not_for_loan_status' fallback to 0 > if itype has it undef >Content-Type: text/plain; charset=utf-8 > >This patch makes the effective not for loan status be set the item value >if not defined at itype level. > >To test: >1. Apply the regressions tests patch >2. Run: > $ ktd --shell > k$ prove t/db_dependent/api/v1/items.t >=> FAIL: Tests fail! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Item.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 4d84ab0981..5bcc917afa 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1470,7 +1470,10 @@ sub to_api { > my $overrides = {}; > > $overrides->{effective_item_type_id} = $self->effective_itemtype; >- $overrides->{effective_not_for_loan_status} = $self->notforloan ? $self->notforloan : $self->itemtype->notforloan; >+ >+ my $itype_notforloan = $self->itemtype->notforloan; >+ $overrides->{effective_not_for_loan_status} = >+ ( defined $itype_notforloan && !$self->notforloan ) ? $itype_notforloan : $self->notforloan; > > return { %$response, %$overrides }; > } >-- >2.30.2
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 35167
:
157948
|
157949
|
157954
|
157955
|
157968
| 157969