[Bug 32801] New: /checkouts?checked_in=1 errors when itemnumber is null
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801 Bug ID: 32801 Summary: /checkouts?checked_in=1 errors when itemnumber is null Change sponsored?: --- Product: Koha Version: 21.11 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: arthur.suzuki@biblibre.com CC: tomascohen@gmail.com When trying to fetch checked_in checkouts for a borrower, if the old_issues doesn't have an itemnumber (for example the item was deleted). It brings a 500 error. This is a message I got while querying this url : /api/v1/checkouts?patron_id=13662&checked_in=1 <pre> {"errors":[{"message":"Expected integer - got null.","path":"\/0\/item_id"},{"message":"Expected integer - got null.","path":"\/1\/item_id"},{"message":"Expected integer - got null.","path":"\/9\/item_id"},{"message":"Expected integer - got null.","path":"\/12\/item_id"},{"message":"Expected integer - got null.","path":"\/13\/item_id"},{"message":"Expected integer - got null.","path":"\/14\/item_id"},{"message":"Expected integer - got null.","path":"\/15\/item_id"}],"status":200} </pre> Querying with itemnumber not null solves the issue : /api/v1/checkouts?patron_id=13662&checked_in=1&q={"item_id":{"-not_like":"null"}} -- 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=32801 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Depends on| |29290 Severity|enhancement |major Version|21.11 |unspecified Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29290 [Bug 29290] Add routes to fetch checkouts for a given biblio -- 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=32801 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=32801 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153044 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153044&action=edit Bug 32801: Add tests -- 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=32801 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153045 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153045&action=edit Bug 32801: Prevent 500 on /checkouts If checked_in flag is passed we return the "old checkouts". But if the item has been deleted we explode with "message":"Expected integer - got null.","path":"\/0\/item_id" The specs should reflect that an item can have been deleted. Test plan: Hit the endpoint and confirm the above. Can be done easily using curl: curl -u koha:koha --request GET 'http://localhost:8081/api/v1/checkouts?patron_id=5&checked_in=1' --header "Content-Type: application/json" | jq -- 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=32801 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com -- 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=32801 Lucas Gass <lucas@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=32801 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153044|0 |1 is obsolete| | --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 153106 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153106&action=edit Bug 32801: Add tests Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153045|0 |1 is obsolete| | --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 153107 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153107&action=edit Bug 32801: Prevent 500 on /checkouts If checked_in flag is passed we return the "old checkouts". But if the item has been deleted we explode with "message":"Expected integer - got null.","path":"\/0\/item_id" The specs should reflect that an item can have been deleted. Test plan: Hit the endpoint and confirm the above. Can be done easily using curl: curl -u koha:koha --request GET 'http://localhost:8081/api/v1/checkouts?patron_id=5&checked_in=1' --header "Content-Type: application/json" | jq Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=32801 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153107|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 153340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153340&action=edit Bug 32801: Prevent 500 on /checkouts If checked_in flag is passed we return the "old checkouts". But if the item has been deleted we explode with "message":"Expected integer - got null.","path":"\/0\/item_id" The specs should reflect that an item can have been deleted. Test plan: Hit the endpoint and confirm the above. Can be done easily using curl: curl -u koha:koha --request GET 'http://localhost:8081/api/v1/checkouts?patron_id=5&checked_in=1' --header "Content-Type: application/json" | jq Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.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=32801 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.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=32801 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.02 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801 --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to 23.05.x for the next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00,23.05.02 |23.11.00,23.05.02,22.11.08 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801 --- Comment #8 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=41889 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org