Bug 32472: [21.11] Force scalar context on acqorder->items
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 15 Dec 2022 10:09:38 +0000 (10:09 +0000)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Mon, 6 Mar 2023 14:43:49 +0000 (14:43 +0000)
commitf85440e677d344837f6a85be3f5f7589497cdcd0
tree4f01cde4ab6e460e6d17dec5106cee8609769e90
parent0336b27bf63bb9494b630d422ef75ed24f40876f
Bug 32472: [21.11] Force scalar context on acqorder->items

This resolves a crash like
    The method Koha::Item->count is not covered by tests!
on the template construction
    [% IF ( order.items.count ) %]
in koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt.

Test plan (21.11):
Receive an order line under this condition: quantityreceived>0 with
items attached to the order line.
Note: Should be possible, comes from production logs.

Look for list context on ->items called from acqorder.
The result of git grep "\->items" is too wide but we could theoretically
miss an occurence with git grep "order.*\->items". With order.* we do
catch $new_order_object->items..

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Koha/Acquisition/Order.pm