Bugzilla – Attachment 144861 Details for
Bug 32472
[21.11 CRASH] The method Koha::Item->count is not covered by tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32472: [21.11] Force scalar context on acqorder->items
0002-Bug-32472-21.11-Force-scalar-context-on-acqorder-ite.patch (text/plain), 1.62 KB, created by
Emmi Takkinen
on 2022-12-28 11:17:31 UTC
(
hide
)
Description:
Bug 32472: [21.11] Force scalar context on acqorder->items
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2022-12-28 11:17:31 UTC
Size:
1.62 KB
patch
obsolete
>From 1dd6bdbbc7c324fcf89c5a83d4c787f09380b935 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 15 Dec 2022 10:09:38 +0000 >Subject: [PATCH 2/2] 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 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index 090920d92c..af4760698c 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/Koha/Acquisition/Order.pm >@@ -319,7 +319,7 @@ sub items { > # There is no FK on items (may have been deleted) > my $items_rs = $self->_result->aqorders_items; > my @itemnumbers = $items_rs->get_column( 'itemnumber' )->all; >- return Koha::Items->search({ itemnumber => \@itemnumbers }); >+ return scalar Koha::Items->search({ itemnumber => \@itemnumbers }); # forcing scalar context for 21.11 prevents crash > } > > =head3 biblio >-- >2.34.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32472
:
144609
|
144610
|
144860
| 144861