[Bug 31128] New: REST API item not_for_loan_status doesn't respect biblio level fallbacks
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Bug ID: 31128 Summary: REST API item not_for_loan_status doesn't respect biblio level fallbacks 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 CC: tomascohen@gmail.com Outside of the UI, the not for loan status is coded to fallback to biblio level not for loan settings if the item is found to be loanable at the item level. We should respect that in the API too. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- As discussed on bug 29105 I opted instead to always add an effective_not_for_loan_status field rather than outright replace it... But, I'm really not sure about this approach.. it feels like we're seeking internal processes a lot here. -- 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=31128 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |29105 Assignee|koha-bugs@lists.koha-commun |martin.renvoize@ptfs-europe |ity.org |.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 [Bug 29105] Add effective_item_type_id to the api items responses -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #2 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 137507 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137507&action=edit Bug 31128: Unit tests This patch adds unit tests for the new effective_not_for_loan_status which I add to the items api responses in this patchset. Test plan 1) Run the unit test without applying the next commit, it should fail 2) RUn the test again after applying the next commit, it should pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #3 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 137508 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137508&action=edit Bug 31128: Add effective_not_for_loan_status into items response -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 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=31128 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=31128 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=31128 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=31128 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137507|0 |1 is obsolete| | --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137574&action=edit Bug 31128: Unit tests This patch adds unit tests for the new effective_not_for_loan_status which I add to the items api responses in this patchset. Test plan 1) Run the unit test without applying the next commit, it should fail 2) RUn the test again after applying the next commit, it should pass -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137508|0 |1 is obsolete| | --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137575 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137575&action=edit Bug 31128: Add effective_not_for_loan_status into items response -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137574|0 |1 is obsolete| | Attachment #137575|0 |1 is obsolete| | --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137576 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137576&action=edit Bug 31128: Unit tests This patch adds unit tests for the new effective_not_for_loan_status which I add to the items api responses in this patchset. Test plan 1) Run the unit test without applying the next commit, it should fail 2) RUn the test again after applying the next commit, it should pass 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=31128 --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 137577 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137577&action=edit Bug 31128: Add effective_not_for_loan_status into items response 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=31128 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Patch complexity|--- |Small patch --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> ---
->status_is( 200, 'SWAGGER3.2.2' )
How can we have Swagger version hardcoded in tests and it still works? Searching for "SWAGGER" shows multiple versions allover the tests and yet it still work :o -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137576|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 137593 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137593&action=edit Bug 31128: Unit tests This patch adds unit tests for the new effective_not_for_loan_status which I add to the items api responses in this patchset. Test plan 1) Run the unit test without applying the next commit, it should fail 2) RUn the test again after applying the next commit, it should pass Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137577|0 |1 is obsolete| | --- Comment #10 from David Nind <david@davidnind.com> --- Created attachment 137594 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=137594&action=edit Bug 31128: Add effective_not_for_loan_status into items response Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #11 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- The bit you highlight Victor is actually just a comment rather than test condition. If I'm honest I'm not sure why that was used as the comment in the first place, I just used the president set in the rest of the test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #12 from Victor Grousset/tuxayo <victor@tuxayo.net> ---
The bit you highlight Victor is actually just a comment rather than test condition.
Ah, it's just string that pops when the test fails. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|REST API item |REST API item not_for_loan |not_for_loan_status doesn't |status doesn't respect |respect biblio level |biblio level fallbacks |fallbacks | QA Contact| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137593|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 138023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138023&action=edit Bug 31128: Unit tests This patch adds unit tests for the new effective_not_for_loan_status which I add to the items api responses in this patchset. Test plan 1) Run the unit test without applying the next commit, it should fail 2) RUn the test again after applying the next commit, it should pass Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137594|0 |1 is obsolete| | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 138024 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=138024&action=edit Bug 31128: Add effective_not_for_loan_status into items response Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|REST API item not_for_loan |Add |status doesn't respect |effective_not_for_loan_stat |biblio level fallbacks |us to API item objects -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #15 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=31128 Bug 31128 depends on bug 29105, which changed state. Bug 29105 Summary: Add effective_item_type_id to the api items responses https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29105 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #16 from David Cook <dcook@prosentient.com.au> --- In 22.11 getting 500 errors with the message {"message":"Expected integer - got null.","path":"\/body\/0\/effective_not_for_loan_status"} Going to keep exploring... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #17 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #16)
In 22.11 getting 500 errors with the message {"message":"Expected integer - got null.","path":"\/body\/0\/effective_not_for_loan_status"}
Going to keep exploring...
Specfically when I'm going to /api/v1/public/biblios/16/items -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #18 from David Cook <dcook@prosentient.com.au> --- Working fine in koha-testing-docker though so maybe something else is going on... :| -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #19 from David Cook <dcook@prosentient.com.au> --- Yep never mind me. Looks like something broken in an instance rather than the Koha version... probably a red herring error message... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #20 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #19)
Yep never mind me. Looks like something broken in an instance rather than the Koha version... probably a red herring error message...
Looks like a number of item types had NULL instead of 0 in the itemtypes table. Ahhhhhhhh. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35167 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35167 [Bug 35167] GET /items* broken if notforloan == 0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Victor Grousset/tuxayo from comment #8)
->status_is( 200, 'SWAGGER3.2.2' )
How can we have Swagger version hardcoded in tests and it still works? Searching for "SWAGGER" shows multiple versions allover the tests and yet it still work :o
We put a reference to the API coding guidelines described behavior we are testing. So 3.2.2 is this: https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER3.2.2_GE... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 --- Comment #22 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to David Cook from comment #16)
In 22.11 getting 500 errors with the message {"message":"Expected integer - got null.","path":"\/body\/0\/effective_not_for_loan_status"}
Going to keep exploring...
We are hitting this in production and I filed bug 35167 to discuss it on its own place. Please join me there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31128 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #23 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #22)
(In reply to David Cook from comment #16)
In 22.11 getting 500 errors with the message {"message":"Expected integer - got null.","path":"\/body\/0\/effective_not_for_loan_status"}
Going to keep exploring...
We are hitting this in production and I filed bug 35167 to discuss it on its own place. Please join me there.
Seeing it too. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org