https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44307 Bug ID: 44307 Summary: /checkouts?checked_in=1 errors when checkout_date or date_due is null Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: alexbuckley@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- In the Koha database schema the old_issues.issuedate, and old_issues.date_due, database fields have a default value of NULL. However, when there are old_issues.issuedate, or old_issues.date_due, fields of NULL then the /checkouts?checked_in=1 endpoint errors with: { message: 'Expected string - got null" path: "/body/0/checkout_date" } or { message: 'Expected string - got null" path: "/body/0/due_date" } --- To recreate: 1. Checkout an item to a patron and check it back in. 2. Do a call to your instance (may need to turn on api basic auth and just use your credentials), see that you get a result. Note down the checkout_id. 3. Update that historic checkout (substituting the checkout_id from above as the issue_id) and restart services: update old_issues set issuedate = NULL where issue_id=<>; restart_all 4. Send the call again, you'll get a error message at the bottom of the comment: {ktdurl}/api/v1/checkouts?checked_in=true&_per_page=5000&_page=1&_order_by=checkout_date { "errors": [ { "message": "Expected string - got null.", "path": "/body/0/checkout_date" }, 5. Run reset_all then repeat steps 1-4 but set old_issues.date_due to NULL and confirm that also throws an API error. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.