https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40970
Bug ID: 40970
Summary: REST API: Searching /biblios with JSON 'q' parameter
fails with SQL error
Change sponsored?: ---
Product: Koha
Version: 25.05
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: REST API
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected]
I was checking out the KOHA REST API and I tried using the query parameters in
/api/v1/biblios by:
1. Authenticate to the REST API.
2. Send a GET request to /api/v1/biblios with a JSON query parameter like
q=[["title", "like", "%Abstract%"]].
This results in a 500 server error:
HTTP error: 500 Server Error: Internal Server Error for url:
api/v1/biblios?_page=1&_per_page=5&q=%5B%5B%22title%22%2C+%22like%22%2C+%22%25Abstract%25%22%5D%5D
Response: {"errors":[{"message":"Internal Server
Error.","path":"\/"}],"status":500}
Looking at the api error logs I have these:
[2025/10/08 10:21:38] [ERROR] 'true' expected, at character offset 0 (before
"title:python") at /usr/share/koha/lib/Koha/REST/Plugin/Objects.pm line 242.
Mojolicious::Plugin::DefaultHelpers::_development
/usr/share/perl5/Mojolicious/Plugin/DefaultHelpers.pm (94)
[2025/10/08 10:23:19] [ERROR] DBIx::Class::Storage::DBI::_dbh_execute(): DBI
Exception: DBD::mysql::st execute failed: Unknown column 'q' in 'where clause'
at /usr/share/perl5/Data/Page.pm line 49
Mojolicious::Plugin::DefaultHelpers::_development
/usr/share/perl5/Mojolicious/Plugin/DefaultHelpers.pm (94)
[2025/10/08 10:29:34] [ERROR] 'true' expected, at character offset 0 (before
"title:Abstract") at /usr/share/koha/lib/Koha/REST/Plugin/Objects.pm line 242.
Mojolicious::Plugin::DefaultHelpers::_development
/usr/share/perl5/Mojolicious/Plugin/DefaultHelpers.pm (94)
[2025/10/08 10:42:07] [ERROR] 'true' expected, at character offset 0 (before
"title:Abstract") at /usr/share/koha/lib/Koha/REST/Plugin/Objects.pm line 242.
Mojolicious::Plugin::DefaultHelpers::_development
/usr/share/perl5/Mojolicious/Plugin/DefaultHelpers.pm (94)
[2025/10/08 10:46:25] [ERROR] DBIx::Class::Storage::DBI::_dbh_execute(): DBI
Exception: DBD::mysql::st execute failed: Unknown column '%Abstract%' in 'where
clause' at /usr/share/perl5/Data/Page.pm line 49
Mojolicious::Plugin::DefaultHelpers::_development
/usr/share/perl5/Mojolicious/Plugin/DefaultHelpers.pm (94)
I could use the other parameters like _page and _per_page but when I use q it
just crashes. Any help would be nice.
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/