[Koha-bugs] [Bug 20540] New: TransformHtmlToXml can duplicate </datafield>

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 6 22:14:05 CEST 2018


            Bug ID: 20540
           Summary: TransformHtmlToXml can duplicate </datafield>
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Cataloging
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: jonathan.druart at bugs.koha-community.org
        QA Contact: testopia at bugs.koha-community.org
                CC: m.de.rooy at rijksmuseum.nl

This bug has been found during testing bug 19289.

In some conditions C4::Biblio::TransformHtmlToXml will generate a malformed XML
structure. The last </datafield> can be duplicated.

For instance, if a call like:
my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values );

with the last value of @field_values is empty, it will return:

<?xml version="1.0" encoding="UTF-8"?>
<datafield2 tag="020" ind1=" " ind2=" ">
<subfield code="a">l</subfield>
<datafield1 tag="100" ind1=" " ind2=" ">
<subfield code="a">k</subfield>
<datafield1 tag="245" ind1=" " ind2=" ">
<subfield code="a">k</subfield>
<datafield1 tag="250" ind1=" " ind2=" ">
<subfield code="a">k</subfield>
<datafield1 tag="260" ind1=" " ind2=" ">
<subfield code="b">k</subfield>
<subfield code="c">k</subfield>

Which will result later in the following error:
:23: parser error : Opening and ending tag mismatch: record line 6 and
:24: parser error : Opening and ending tag mismatch: collection line 2 and
:25: parser error : Extra content at the end of the document

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