[Koha-bugs] [Bug 27161] New: Base.pm complains about unitialized value

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 7 06:06:51 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27161

            Bug ID: 27161
           Summary: Base.pm complains about unitialized value
 Change sponsored?: ---
           Product: Koha
           Version: 19.11
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: cornejo.alvaro at gmail.com
        QA Contact: testopia at bugs.koha-community.org

I get several errors on 

 Use of uninitialized value in subroutine entry at
/usr/share/koha/lib/Koha/Plugins/Base.pm line 182.

177 sub get_metadata {
178     my ( $self, $args ) = @_;
179
180     #FIXME: Why another encoding issue? For metadata containing non latin
characters.
181     my $metadata = $self->{metadata};
182         utf8::decode($metadata->{$_}) for keys %$metadata;
183     return $metadata;
184 }


Verifying that $metadata value is set before applying utf8::decode will avoid
that log error

177 sub get_metadata {
178     my ( $self, $args ) = @_;
179
180     #FIXME: Why another encoding issue? For metadata containing non latin
characters.
181     my $metadata = $self->{metadata};
182     if ($metadata !~ "") {
183         utf8::decode($metadata->{$_}) for keys %$metadata;
184         }
185     return $metadata;
186 }

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list