From 32bfd2fe945e7aef6f489ddaf1c80be018622663 Mon Sep 17 00:00:00 2001 From: Alvaro Cornejo Date: Fri, 11 Dec 2020 23:02:06 -0500 Subject: [PATCH] Bug 27161: Base.pm complains about unitialized value This patch does validate that $metadata exists and is set in sub get_metadata TEST PLAN Before applying the patch tail plack error log and see errors like: Use of uninitialized value in subroutine entry at line 182 in Base.pm Apply the patch restart koha-common service tail plack error log and verify no more erros appear. --- Koha/Plugins/Base.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm index 295e351c86..8c7b1924e6 100644 --- a/Koha/Plugins/Base.pm +++ b/Koha/Plugins/Base.pm @@ -179,7 +179,9 @@ sub get_metadata { #FIXME: Why another encoding issue? For metadata containing non latin characters. my $metadata = $self->{metadata}; - utf8::decode($metadata->{$_}) for keys %$metadata; + if ( $metadata & $metadata !~ "") { + utf8::decode($metadata->{$_}) for keys %$metadata; + } return $metadata; } -- 2.17.1