Bug 41889

Summary: /checkouts?checked_in=1 errors when patron_id is null
Product: Koha Reporter: Lisette Scheer <lisette>
Component: CirculationAssignee: Lisette Scheer <lisette>
Status: ASSIGNED --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32801
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Lisette Scheer 2026-02-19 21:12:58 UTC
To recreate:
Checkout an item to a patron without anonymization and check it back in.

Do a call to your instance (may need to turn on api basic auth and just use your credentials)  that includes the date in question, see that you get a result.

Delete the patron and send the call again, you'll get the error message at the bottom of the comment.

This is a problem with third party report services.

{ktdurl}/api/v1/checkouts?q={"checkout_date":{">": "2026-01-24T00:00:00Z","<": "2026-07-31T00:00:00Z"}}&checked_in=true&_per_page=5000&_page=1&_order_by=checkout_date

Recreated on main, seeing it back at least to old stable. 

{
    "errors": [
        {
            "message": "Expected integer - got null.",
            "path": "/body/0/patron_id"
        },
Comment 1 Lisette Scheer 2026-02-20 15:22:14 UTC
Now I can't recreate on main, but I'm getting a booking related error instead. This might be fixed and my git worktrees were messed up.
Comment 2 Lisette Scheer 2026-02-20 16:41:27 UTC
Recreated on main, working on a patch.