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

--- Comment #113 from Arthur Suzuki <[email protected]> ---
Hello,
In some condition the code could fail :
in the sub _get_deleted_biblio_for_export :
----
    # Creating schema is expensive, allow caller to                             
    # pass it so don't have to recreate for each call                           
    my $resultset       = $params->{resultset} ||
Koha::Database->new()->schema()->resultset('DeletedbiblioMetadata');
    my $marc_flavour    = C4::Context->preference('marcflavour');
    my $biblio_metadata = $resultset->find(
        {
            'biblionumber' => $biblionumber,
            'format'       => 'marcxml',
            'schema'       => $marc_flavour
        }
    );
    my $marc_xml = $biblio_metadata->metadata;
    $marc_xml = StripNonXmlChars($marc_xml);
----

It seems that an empty result set could lead to querying an empty
$biblio_metadata object, resulting in a crash.
Probably should warn about "no deleted records" and early return in case of
empty resultset?

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to