[Bug 44046] New: Exporting records silently skips records whose MARC cannot be read
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44046 Bug ID: 44046 Summary: Exporting records silently skips records whose MARC cannot be read Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Koha::Exporter::Record (Tools > Export data, and misc/export_records.pl) skips any bibliographic record whose stored MARCXML does not parse, or (ISO 2709) does not encode, and carries on. Nothing tells the person exporting: - the command line shows only the parser's own lines (e.g. "PCDATA invalid Char value 31"), with no biblionumber; - "Record N could not be exported" goes only to the Koha logger, and for ISO 2709 at info level, which is usually not written; - export_records.pl exits 0, and the download from the Export screen simply lacks the record. An export used for a migration or a backup can therefore come out short with nothing saying so. To reproduce: put a control character (e.g. 0x1F) into one record's biblio_metadata.metadata, then run misc/export_records.pl --format=xml (or iso2709) --filename=out --starting_biblionumber/--ending_biblionumber around it: the file has one record fewer, the output names no record, the exit code is 0. Reproduced on Koha 26.05.02 (1,093 of 1,094 sample records exported, exit 0); the same code is on main. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44046 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 211191 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211191&action=edit Bug 44046: Report records that could not be exported Bug 44046: Report records that could not be exported Koha::Exporter::Record skipped any record whose MARC could not be read (or encoded as ISO 2709) and only logged it, for ISO 2709 at info level. Neither misc/export_records.pl nor its caller could tell the export came out short. export() now returns the records it skipped, each with a reason, logs them at warn level, and export_records.pl prints them and a count on STDERR. Test plan: 1. prove t/db_dependent/Exporter/Record.t The new checks fail without the patch. 2. Break one record: in biblio_metadata, put a control character (0x1F) into its metadata. 3. misc/export_records.pl --format=xml --filename=/tmp/out.xml --starting_biblionumber=<n> --ending_biblionumber=<n+1> 4. Without the patch: no line names the record, the file lacks it. 5. With the patch: "Record <n> could not be exported: the record could not be read" and "1 record(s) could not be exported." on STDERR. 6. Repeat 3 with --format=iso2709. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44046 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org