From 26d58518903f48a6fea1f2fdb1e6aadcd05bf2da Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 11 Jul 2022 13:07:28 +0100 Subject: [PATCH] Bug 31128: Add effective_not_for_loan_status into items response --- Koha/Item.pm | 2 +- api/v1/swagger/definitions/item.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 55e91182ee..e558f2e2a0 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -1310,7 +1310,7 @@ sub to_api { my $overrides = {}; $overrides->{effective_item_type_id} = $self->effective_itemtype; - $overrides->{not_for_loan_status} = $self->itemtype->notforloan unless $self->notforloan; + $overrides->{effective_not_for_loan_status} = $self->notforloan ? $self->notforloan : $self->itemtype->notforloan; return { %$response, %$overrides }; } diff --git a/api/v1/swagger/definitions/item.yaml b/api/v1/swagger/definitions/item.yaml index 48bd53647e..e67b53813e 100644 --- a/api/v1/swagger/definitions/item.yaml +++ b/api/v1/swagger/definitions/item.yaml @@ -59,6 +59,9 @@ properties: not_for_loan_status: type: integer description: Authorized value defining why this item is not for loan + effective_not_for_loan_status: + type: integer + description: Authorized value defining why this item is not for not_for_loan_status damaged_status: type: integer description: Authorized value defining this item as damaged -- 2.20.1