[Koha-bugs] [Bug 30043] New: Malformed records shown as not existing

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 8 11:46:16 CET 2022


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

            Bug ID: 30043
           Summary: Malformed records shown as not existing
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: MARC Bibliographic data support
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: magnus at libriotech.no
        QA Contact: testopia at bugs.koha-community.org

I just had a case where a batch MARC import script (not part of Koha, but
maintained separately) had put some records with an empty 942 field into the
database. The MARCXML looked something like this:

  <datafield tag="887" ind1=" " ind2=" ">
    <subfield code="a">x</subfield>
  </datafield>
  <datafield tag="942" ind1=" " ind2=" ">
  </datafield>
  <datafield tag="950" ind1=" " ind2="k">
    <subfield code="a">y</subfield>
  </datafield>


When trying to view these records, the following message was displayed:

The record you requested does not exist

But all the data were in the biblio, biblioitems, biblio_metadata tables. It
was not possible to view the the record in the editor either. 

Would it be possible to catch this error and say something like "The record you
requested has fatal errors" instead of telling the user it does not exist? 

Relevant code in catalogue/detail.pl:

 78 my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
 79 my $biblio = Koha::Biblios->find( $biblionumber );
 80 $template->param( 'biblio', $biblio );
 81 
 82 if ( not defined $record ) {
 83     # biblionumber invalid -> report and exit
 84     $template->param( unknownbiblionumber => 1,
 85                       biblionumber => $biblionumber );
 86     output_html_with_http_headers $query, $cookie, $template->output;
 87     exit;
 88 }

This reports unknownbiblionumber => 1 when $record is not defined, but it does
not differentiate between "biblionumber does not exist" and "biblionumber
points to a broken MARCXML record".

-- 
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