Jonathan Druart
cc8f3dc1cc
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"?> <collection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd" xmlns="http://www.loc.gov/MARC21/slim"> <record> <datafield2 tag="020" ind1=" " ind2=" "> <subfield code="a">l</subfield> </datafield> <datafield1 tag="100" ind1=" " ind2=" "> <subfield code="a">k</subfield> </datafield> <datafield1 tag="245" ind1=" " ind2=" "> <subfield code="a">k</subfield> </datafield> <datafield1 tag="250" ind1=" " ind2=" "> <subfield code="a">k</subfield> </datafield> <datafield1 tag="260" ind1=" " ind2=" "> <subfield code="b">k</subfield> <subfield code="c">k</subfield> </datafield> </datafield> </record> </collection> Which will result later in the following error: :23: parser error : Opening and ending tag mismatch: record line 6 and datafield </datafield> ^ :24: parser error : Opening and ending tag mismatch: collection line 2 and record </record> ^ :25: parser error : Extra content at the end of the document </collection> Test plan: You can test it along with bug 19289 and confirm that it fixes the problem raised on bug 19289 comment 30 Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> |
||
---|---|---|
.. | ||
Acquisition | ||
Biblio | ||
Budgets | ||
Circulation | ||
db_dependent | ||
edi_testfiles | ||
etc | ||
External | ||
Koha | ||
lib | ||
Members | ||
Number | ||
Search | ||
Serials | ||
SIP | ||
Test | ||
00-checkdatabase-version.t | ||
00-deprecated.t | ||
00-load.t | ||
00-merge-conflict-markers.t | ||
00-testcritic.t | ||
00-valid-xml.t | ||
Auth_with_shibboleth.t | ||
AuthoritiesMarc_MARC21.t | ||
AuthoritiesMarc_UNIMARC.t | ||
AuthUtils.t | ||
Barcodes_annual.t | ||
Barcodes_EAN13.t | ||
Barcodes_hbyymmincr.t | ||
Barcodes_incremental.t | ||
Biblio.t | ||
Biblio2.t | ||
Bookseller.t | ||
Boolean.t | ||
Budgets.t | ||
Cache.t | ||
Calendar.t | ||
Charset.t | ||
Circulation_barcodedecode.t | ||
ClassSortRoutine.t | ||
ClassSortRoutine_Dewey.t | ||
ClassSortRoutine_Generic.t | ||
ClassSortRoutine_LCC.t | ||
ClassSource.t | ||
Context.t | ||
Contract.t | ||
Creators.t | ||
DateUtils.t | ||
Debug.t | ||
dummy.t | ||
Edifact.t | ||
EdiInvoice.t | ||
Ediorder.t | ||
Ediordrsp.t | ||
Form_MessagingPreferences.t | ||
Heading.t | ||
HtmlTags.t | ||
Images.t | ||
ImportBatch.t | ||
Installer_PerlDependencies.t | ||
Installer_PerlModules.t | ||
Installer_pm.t | ||
ItemCirculationAlertPreference.t | ||
Koha.t | ||
Koha_Email.t | ||
Koha_ExternalContent_OverDrive.t | ||
Koha_MetadataRecord.t | ||
Koha_Template_Plugin_Cache.t | ||
Koha_Template_Plugin_Koha.t | ||
Koha_Template_Plugin_KohaPlugins.t | ||
Koha_Util_FrameworkPlugin.t | ||
Koha_Util_MARC.t | ||
Labels.t | ||
Labels_split_ccn.t | ||
Labels_split_ddcn.t | ||
Labels_split_lccn.t | ||
Languages.t | ||
Letters.t | ||
Log.t | ||
Logger.t | ||
Makefile.t | ||
Matcher.t | ||
Members_Attributes.t | ||
Members_AttributeTypes.t | ||
Members_Messaging.t | ||
NorwegianPatronDB.t | ||
OpenLibrarySearch.t | ||
Output.t | ||
Output_JSONStream.t | ||
Patron.t | ||
Patroncards.t | ||
Patroncards_Batch.t | ||
Patroncards_Layout.t | ||
Patroncards_Lib.t | ||
Patroncards_Patroncard.t | ||
Patroncards_Profile.t | ||
Patroncards_Template.t | ||
perlcriticrc | ||
Prices.t | ||
Print.t | ||
QueryParser.t | ||
RecordProcessor.t | ||
Ris.t | ||
Scheduler.t | ||
Scrubber.t | ||
Search.t | ||
Search_PazPar2.t | ||
SimpleMARC.t | ||
SMS.t | ||
SocialData.t | ||
Stats.t | ||
SuggestionEngine.t | ||
SuggestionEngine_AuthorityFile.t | ||
timezones.t | ||
TmplToken.t | ||
Token.t | ||
XSLT.t |