From 76f1db00892ec7edd527dcf331c924c9bbdb6c97 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 28 Apr 2022 10:04:02 +0000 Subject: [PATCH] Bug 30638: Resolve odd number in hash warn in Letters Content-Type: text/plain; charset=utf-8 Odd number of elements in anonymous hash at C4/Letters.pm line 827. Trivial fix. Adding undefined check on result to prevent warns on that one. No test plan. Read the patch. Signed-off-by: Marcel de Rooy --- C4/Letters.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 7c63b23d8e..9ed1de0e44 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -824,8 +824,9 @@ sub _parseletter { $dateonly = $1 unless $dateonly; } my $replacedby_date = eval { - output_pref({ dt => dt_from_string( $replacedby ), dateonly => $dateonly }); + output_pref({ dt => scalar dt_from_string( $replacedby ), dateonly => $dateonly }); }; + $replacedby_date //= q{}; if ( $letter->{ $letter_field } ) { $letter->{ $letter_field } =~ s/\Q<<$table.$field$filter_string_used>>\E/$replacedby_date/g; -- 2.20.1