Summary: | tools/export.pl fix to forbid adding of all invalid records | ||
---|---|---|---|
Product: | Koha | Reporter: | Stéphane Delaune <stephane.delaune> |
Component: | Tools | Assignee: | Stéphane Delaune <stephane.delaune> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P3 | CC: | f.demians, fridolin.somers, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 12229 | ||
Bug Blocks: | |||
Attachments: |
proposed patch
proposed patch Bug 13082: fix to prevent adding of invalid records in marc file [PASSED QA] Bug 13082: fix to prevent adding of invalid records in marc file |
Description
Stéphane Delaune
2014-10-15 10:01:50 UTC
Created attachment 32332 [details] [review] proposed patch Created attachment 32557 [details] [review] proposed patch proposed patch : excludes records with marc-record's errors and also other non-marc fatal errors (eg. "utf8 "\xCF" does not map to Unicode at /usr/lib/perl/5.10/Encode.pm line 174.") Created attachment 32715 [details] [review] Bug 13082: fix to prevent adding of invalid records in marc file Test: 1. Edit record, add 100.000 chars text to 500a 2. xml export produce the record, 3. mrc export do not produce the record, warning on log export.pl: Record length of 111000 is larger than the MARC spec allows (99999 bytes). at /usr/share/perl5/MARC/File/USMARC.pm line 314. record (number 139489) is invalid and therefore not exported because its reopening generates warnings above at... Signed-off-by: Frederic Demians <f.demians@tamil.fr> I confirm that exporting biblio records larger than 10000 characters in ISO2709 produces invalid files. After applying this patch, the culprit record (too large, but also other inconsistencies preventing record parsing with MARC::File::USMARC) is not exported anymore. A warning is produced in Koha Apache log file. Warnings to the user on WUI would be better, but it isn't the case yet, so it isn't a regression. Created attachment 32718 [details] [review] [PASSED QA] Bug 13082: fix to prevent adding of invalid records in marc file Test: 1. Edit record, add 100.000 chars text to 500a 2. xml export produce the record, 3. mrc export do not produce the record, warning on log export.pl: Record length of 111000 is larger than the MARC spec allows (99999 bytes). at /usr/share/perl5/MARC/File/USMARC.pm line 314. record (number 139489) is invalid and therefore not exported because its reopening generates warnings above at... Signed-off-by: Frederic Demians <f.demians@tamil.fr> I confirm that exporting biblio records larger than 10000 characters in ISO2709 produces invalid files. After applying this patch, the culprit record (too large, but also other inconsistencies preventing record parsing with MARC::File::USMARC) is not exported anymore. A warning is produced in Koha Apache log file. Warnings to the user on WUI would be better, but it isn't the case yet, so it isn't a regression. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> I agree that a visible warning/result message in the staff interface would be nice, but this works as described. Patch pushed to master. Thanks Stéphane! |