[Bug 29105] New: items responses do not respect effective_itemtype
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Bug ID: 29105 Summary: items responses do not respect effective_itemtype Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@ptfs-europe.com The item objects we return from various items API routes do not respect the effective itype offerings. Example, itype is mapped directly from the item itype field to item_type.. it should check for effective itemtype and return the result of that. Similarly notforloan is mapped directly, but can depend on the effective itemtype. There are possibly others. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm not sure how to tackle this, I think it will need a to_api or TO_JSON overload or something.? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125235 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125235&action=edit Bug 29105: Add effective_itemtype handling for Item API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29107 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125251 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125251&action=edit Bug 29105: Unit test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #4 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125252 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125252&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125235|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=29108 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- So this patch does one direction (i.e. results), but doesn't cater for searches using q_param yet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- When dealing with an 'item' object it is legit to set item_type to null. Returning the effective (calculated if absent on the item) item type might confuse the consumer to think it has an item_type set. I'd prefer we add the option to embed the effective item_type like in: x-koha-embed: effective_item_type -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Hmm.. difficult. I can see where you're coming from... but I'd be tempted to not require an embed to enable it's return and rather return it as a standard field.. so itype + effective_itype fields both always present in the result? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Martin Renvoize from comment #7)
Hmm.. difficult. I can see where you're coming from... but I'd be tempted to not require an embed to enable it's return and rather return it as a standard field.. so itype + effective_itype fields both always present in the result?
Yes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- + $self->notforloan( $self->itemtype->notforloan ) unless $self->notforloan; $self->notforloan may be 0 so we should use defined no ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |In Discussion --- Comment #10 from David Nind <david@davidnind.com> --- Changed status to 'In discussion', feel free to change the status back to NSO when it is ready for testing (including a test plan). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125251|0 |1 is obsolete| | --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 137504 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137504&action=edit Bug 29105: Unit test This patch adds a unit test for the addition of effective_item_type_id to the items responses. Test plan 1) Run the unit test prior to applying the second patch and confirm it fails 2) Apply the second patch and confirm the unit test now passes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125252|0 |1 is obsolete| | --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 137505 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137505&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff Summary|items responses do not |Add effective_item_type_id |respect effective_itemtype |to the api items responses -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Patches updated as requested and not handling notforloan status as I'll submit that as another bug We now return both item_type_id and the new effective_item_type_id field in the same response. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- I'm still somewhat torn here.. it feels wrong somehow to require intimate knowledge of how Koha works with regards to overloading features to be able to use this API route.. an average consumer won't necessarily understand the difference between these fields. I wondered about taking an alternate approach of requiring a header to revert from automatically replacing item_type_id with the effective equivalent instead to allow for Koha staff client use on the editing of item pages. Difficult! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |31128 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 [Bug 31128] REST API item not_for_loan_status doesn't respect biblio level fallbacks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |31084 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31084 [Bug 31084] Display item type in bundle management table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137504|0 |1 is obsolete| | --- Comment #15 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137572 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137572&action=edit Bug 29105: Unit test This patch adds a unit test for the addition of effective_item_type_id to the items responses. Test plan 1) Run the unit test prior to applying the second patch and confirm it fails 2) Apply the second patch and confirm the unit test now passes Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137505|0 |1 is obsolete| | --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137573&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |nick@bywatersolutions.com --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- I think this is fine, as long as this feature (item-level_itpyes set to 'biblio') exists - libraries using biblio itemtypes seem to be in the minority according to: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 If we remove the feature later, we remove the extra field small patch, straight to PQA to let RM weigh in -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|22.11.00 |22.11.00, 22.05.05 released in| | Status|Pushed to master |Pushed to stable --- Comment #19 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |arthur.suzuki@biblibre.com Version(s)|22.11.00, 22.05.05 |22.11.00, 22.05.05, released in| |21.11.12 --- Comment #20 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- thx pushed to 21.11.x for 21.11.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED --- Comment #21 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. API doc is generated, nothing to document, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add effective_item_type_id |Add effective_item_type_id |to the api items responses |to the API items responses -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org