[Bug 40920] New: Checkout endpoint crashes with parameter "patron_id"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40920 Bug ID: 40920 Summary: Checkout endpoint crashes with parameter "patron_id" Change sponsored?: --- Product: Koha Version: 24.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: arthur.suzuki@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: tomascohen@gmail.com A call to /api/v1/checkouts?patron_id=51 crashes Koha. We get this in the logs: Unknown column 'patron_id' in 'WHERE' at /home/koha/src/Koha/REST/Plugin/Objects.pm I tried to replace patron_id parameter with "borrowernumber" in the request but it crashes as well as borrowernumber is not a valid input. This is a regression from 23.11 we experienced in 24.11 and main. I've made a small patch to solve this but there is probably a better way to do it. -- 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=40920 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- 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=40920 --- Comment #1 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 187160 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187160&action=edit Bug 40920: fix invalid patron_id parameter Test plan: - on KTD, without patch, create an issue for user "koha" (patron_id 51) - go to http://localhost:8081/api/v1/checkouts?patron_id=51 - you should get an error (and no issues) - in /var/log/koha/plack-api-error.log you will see "Unknown column 'patron_id'". - apply patch and "restart_all" - make the same request to the api - you should see the issue for user koha. -- 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=40920 --- Comment #2 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- to be more specific, the failing request is the following : http://localhost:8081//api/v1/checkouts?q={%22item_id%22:{%22-not_like%22:%22null%22}}&_match=exact&_page=1&_per_page=20&checked_in=1&patron_id=51 (we don't want to get the deleted_items in the checkout history) -- 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=40920 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |WONTFIX --- Comment #3 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- we solved the problem by fixing the way our client software calls koha's API. This don't need to be fixed anymore. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org