Bug 33974: (follow-up) _order_by is not always an arrayref
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 6 Jul 2023 18:50:40 +0000 (15:50 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 6 Jul 2023 18:55:06 +0000 (15:55 -0300)
commitd90d264253134a1c6fa7dbb64b959bd7d3789fce
treebf2895d3e9c8f9fb4db369454ebf4fbae36ab9a8
parentf3cc00d945ecdd74f84c9183e3fb9655248b0e68
Bug 33974: (follow-up) _order_by is not always an arrayref

The loop through the `_order_by` query parameter occurences introduced
by this patchset was naive regarding the possible scenarios.

When there's only one parameter passed, it shouldn't be expecting an
arrayref, but a scalar. This patch deals with that in the simplest way.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/REST/Plugin/Objects.pm