Summary: | /checkouts?checked_in=1 errors when itemnumber is null | ||
---|---|---|---|
Product: | Koha | Reporter: | Arthur Suzuki <arthur.suzuki> |
Component: | REST API | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P5 - low | CC: | jonathan.druart, tomascohen |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.11.00,23.05.02,22.11.08
|
|
Circulation function: | |||
Bug Depends on: | 29290 | ||
Bug Blocks: | |||
Attachments: |
Bug 32801: Add tests
Bug 32801: Prevent 500 on /checkouts Bug 32801: Add tests Bug 32801: Prevent 500 on /checkouts Bug 32801: Prevent 500 on /checkouts |
Description
Arthur Suzuki
2023-02-02 16:26:45 UTC
Created attachment 153044 [details] [review] Bug 32801: Add tests Created attachment 153045 [details] [review] 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 Created attachment 153106 [details] [review] Bug 32801: Add tests Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 153107 [details] [review] 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> Created attachment 153340 [details] [review] 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> Pushed to master for 23.11. Nice work everyone, thanks! Thanks for all the hard work! Pushed to 23.05.x for the next release Nice work everyone! Pushed to oldstable for 22.11.x |