Bugzilla – Attachment 186811 Details for
Bug 40861
"Odd number of elements in anonymous hash" warning in serials/acqui-search-result.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40861: Remove warning from serials/acqui-search-result.pl
Bug-40861-Remove-warning-from-serialsacqui-search-.patch (text/plain), 2.28 KB, created by
Marcel de Rooy
on 2025-09-23 14:25:37 UTC
(
hide
)
Description:
Bug 40861: Remove warning from serials/acqui-search-result.pl
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-09-23 14:25:37 UTC
Size:
2.28 KB
patch
obsolete
>From e0a9a833c6b5d31b2fd41d88553d3b81d5ea5198 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 23 Sep 2025 16:19:16 +0200 >Subject: [PATCH] Bug 40861: Remove warning from serials/acqui-search-result.pl >Content-Type: text/plain; charset=utf-8 > >Odd number of elements in anonymous hash at /kohadevbox/koha/serials/acqui-search-result.pl line 84. > >it's coming from closedate that is empty, and output_pref that will >reach this return: >278 if ($str) { >279 local $@; >280 $dt = eval { dt_from_string($str) }; >281 Koha::Exceptions::WrongParameter->throw("Invalid date '$str' passed to output_pref") if $@; >282 } >283 >284 return if !defined $dt; # NULL date > >if str is undef, we don't enter if l.278 and return l.284 >which will shift the elements of the hash (because of the list context) > >We force the scalar and we are good. > >There was no side-effect because closedate was the last of the list. > >Note that total (and the 'count(*)' key) is not used in the template. > >Test plan: >Create an order for a basket of the first vendor "My vendor" and hit >http://localhost:8081/cgi-bin/koha/serials/acqui-search-result.pl?supplier=d >Without this patch you get the warning >Odd number of elements in anonymous hash at /kohadevbox/koha/serials/acqui-search-result.pl line 84. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > serials/acqui-search-result.pl | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > >diff --git a/serials/acqui-search-result.pl b/serials/acqui-search-result.pl >index 6566f2194d..609d874d26 100755 >--- a/serials/acqui-search-result.pl >+++ b/serials/acqui-search-result.pl >@@ -77,10 +77,9 @@ for my $s (@suppliers) { > for my $ord ( @{$orders} ) { > push @{$loop_basket}, { > basketno => $ord->{'basketno'}, >- total => $ord->{'count(*)'}, > authorisedby => $ord->{'authorisedby'}, >- creationdate => output_pref( { str => $ord->{'creationdate'} } ), >- closedate => output_pref( { str => $ord->{'closedate'} } ), >+ creationdate => scalar output_pref( { str => $ord->{'creationdate'} } ), >+ closedate => scalar output_pref( { str => $ord->{'closedate'} } ), > }; > } > push @{$loop_suppliers}, { >-- >2.39.5
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 40861
:
186810
| 186811