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)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Tue, 18 Jul 2023 14:44:59 +0000 (14:44 +0000)
commit7b1a93295e4f74933ede63f96f5fbd90bad38674
treebb4c537419ba68a56040f186a92063af914d430c
parente7211b502f97d3eec68982f5c08192c74dc397cf
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>
(cherry picked from commit d90d264253134a1c6fa7dbb64b959bd7d3789fce)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a16356ae2846a76b2a226d44f5498d0389f87ae9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Koha/REST/Plugin/Objects.pm