Bug 29806: Fix POST /holds use of pickup_locations
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 6 Jan 2022 12:27:45 +0000 (09:27 -0300)
committerKyle Hall <kyle@bywatersolutions.com>
Mon, 7 Feb 2022 11:40:36 +0000 (06:40 -0500)
commit78b5f207cbe8eeb41d6a7ce10944a6e56100bb83
treebbbd494f3ea676129686a7a65b6a52d7e6ec073a
parent6812dd0b72a0ae8529f6191d15ba68e3707fffc5
Bug 29806: Fix POST /holds use of pickup_locations

This patch makes Koha::Item->pickup_locations and
Koha::Biblio->pickup_locations explicitly call ->as_list in list
context. This way we workaround bug 28871.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, the route gives a 500 (unhandled exception)
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass, the route correctly returns a 400 with a
message about the pickup location being invalid
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/REST/V1/Holds.pm