https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24432
Bug ID: 24432 Summary: Request an endpoint with a date column in order by throws bad parameter exception Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: blocker Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: agustinmoy...@theke.io CC: tomasco...@gmail.com Depends on: 23893 Blocks: 20936 When you request an endpoint in the API with a date as orderby, it throws Koha::Exceptions::BadParameter. Koha::REST::Plugin::Query in _build_order_atom, in order to get the model parameter for the order by, it requests {instance of Koha::Objects}->attributes_from_api({ <api parameter name> => 1 }); to get that hash translated, and use the resulting key as the model column to do the order by. This works ok for all datatypes except date types, because it's trying to transate the value of "1" as a date, throwig the mentioned exception. In my opinion, _build_order_atom should not use attributes_from_api, but should use the mapping in Koha::Object to get the column name. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20936 [Bug 20936] Holds History for patrons in OPAC https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23893 [Bug 23893] Add ->new_from_api and ->set_from_api methods to Koha::Object -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org 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/