Bugzilla – Attachment 125252 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.17 KB, created by
Martin Renvoize
on 2021-09-24 14:16:51 UTC
(
hide
)
Description:
Bug 29105: Add effective_itemtype handling to items api
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2021-09-24 14:16:51 UTC
Size:
1.17 KB
patch
obsolete
>From c3040cf09fb6d7db0acfa63e72bc2fe627fcd76d 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_itemtype handling to the items api. > >We overload the to_api method to replace the itype column value with >that of the effective itemtype code. > >We also add in the notforloan fallback that is apparent in >catalogue/details.tt status templates. >--- > Koha/Item.pm | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 60d80a5c3eb..b1310859c7d 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1104,6 +1104,20 @@ sub _set_found_trigger { > return $self; > } > >+=head3 to_api >+ >+Overloaded to_api method to ensure item-level itypes is adhered to. >+ >+=cut >+ >+sub to_api { >+ my ($self, $params) = @_; >+ >+ $self->itype( $self->effective_itemtype ); >+ $self->notforloan( $self->itemtype->notforloan ) unless $self->notforloan; >+ return $self->SUPER::to_api($params); >+} >+ > =head3 to_api_mapping > > This method returns the mapping for representing a Koha::Item object >-- >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 29105
:
125235
|
125251
|
125252
|
137504
|
137505
|
137572
|
137573