Koha-clms/Koha/REST/Plugin
Tomas Cohen Arazi 2550b3b608 Bug 30165: (follow-up) Allow objects.search usage outside OpenAPI
Our objects.search helper is written for being used in our API
controllers, which get their query parameters processed by the OpenAPI
plugin, using JSON::Validator.

Particularly, the 'q' parameter is defined as 'multi' on our spec, which
means objects.search always gets it as an arrayref.

As the Objects.t tests are not using the OpenAPI plugin, a hashref is
generated as only one q= is being passed. This patch adds an extra
validation on objects.search, for the non-arrayref use case and does the
right thing.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2022-03-25 10:41:01 -04:00
..
Exceptions.pm Bug 25493: Make ->unhandled_exception use Koha::Logger 2020-05-19 15:20:43 +01:00
Objects.pm Bug 30165: (follow-up) Allow objects.search usage outside OpenAPI 2022-03-25 10:41:01 -04:00
Pagination.pm Bug 27353: Set X-Base-Total-Count header for REST API 2021-01-28 16:41:21 +01:00
PluginRoutes.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Query.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00