Koha-clms/serials
Jonathan Druart 6ebf2b7e45
Bug 40861: Remove warning from serials/acqui-search-result.pl
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>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 71619f90e5)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
2025-09-25 16:22:55 +02:00
..
acqui-search-result.pl Bug 40861: Remove warning from serials/acqui-search-result.pl 2025-09-25 16:22:55 +02:00
acqui-search.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
checkexpiration.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
claims.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
create-numberpattern.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
lateissues-export.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
reorder_members.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
routing-preview.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
routing.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
serials-collection.pl Bug 34971: Fix permission to close a serial subscription (edit) 2025-02-12 15:28:16 +01:00
serials-edit.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
serials-home.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
serials-search.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
showpredictionpattern.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-add.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-batchedit.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-bib-search.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-detail.pl Bug 34971: (QA follow-up) Op is now cud-reopen 2025-02-12 15:28:17 +01:00
subscription-frequencies.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-frequency.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-history.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-numberpattern.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-numberpatterns.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
subscription-renew.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
viewalerts.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00