Bugzilla – Attachment 137573 Details for
Bug 29105
Add effective_item_type_id to the API items responses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29105: Add effective_itemtype handling to items api
Bug-29105-Add-effectiveitemtype-handling-to-items-.patch (text/plain), 1.72 KB, created by
Nick Clemens (kidclamp)
on 2022-07-11 16:09:18 UTC
(
hide
)
Description:
Bug 29105: Add effective_itemtype handling to items api
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-07-11 16:09:18 UTC
Size:
1.72 KB
patch
obsolete
>From 5b64a11224a57987703ff4e1adbf624ae6779453 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 24 Sep 2021 12:19:12 +0100 >Subject: [PATCH] Bug 29105: Add effective_itemtype handling to items api > >This patch adds effective_item_type_id to the items api. > >We overload the to_api method to append the effective_item_type_id field >with that of the effective itemtype code. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Item.pm | 17 +++++++++++++++++ > api/v1/swagger/definitions/item.yaml | 5 +++++ > 2 files changed, 22 insertions(+) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 16d6f95bed..42cb565f64 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1273,6 +1273,23 @@ sub public_read_list { > ]; > } > >+=head3 to_api >+ >+Overloaded to_api method to ensure item-level itypes is adhered to. >+ >+=cut >+ >+sub to_api { >+ my ($self, $params) = @_; >+ >+ my $response = $self->SUPER::to_api($params); >+ my $overrides = {}; >+ >+ $overrides->{effective_item_type_id} = $self->effective_itemtype; >+ >+ return { %$response, %$overrides }; >+} >+ > =head3 to_api_mapping > > This method returns the mapping for representing a Koha::Item object >diff --git a/api/v1/swagger/definitions/item.yaml b/api/v1/swagger/definitions/item.yaml >index 8b00c96c88..48bd53647e 100644 >--- a/api/v1/swagger/definitions/item.yaml >+++ b/api/v1/swagger/definitions/item.yaml >@@ -183,6 +183,11 @@ properties: > - string > - "null" > description: Itemtype defining the type for this item >+ effective_item_type_id: >+ type: >+ - string >+ - "null" >+ description: Effective itemtype defining the type for this item_id > extended_subfields: > type: > - string >-- >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 29105
:
125235
|
125251
|
125252
|
137504
|
137505
|
137572
| 137573