From 1f72a1c2dd45c3a570746dd575b0fcfb38d13dc4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Delaune?= Date: Mon, 12 May 2014 16:58:14 +0200 Subject: [PATCH] Bug 12229: when exporting MARC records (as ISO2709), refuse to output records that would be longer than the MARC limit Test: 1. Edit a bib record, add 100.000 chars text to 500a 2. Go to Tools -> Export data (or run tools/export.pl on the command line) 3. Verify that exporting as XML includes the record 4. Verify that exporting as MARC does not include the record, and that you get the following warning: export.pl: record (number 2025) length 102668 is larger than the MARC spec allows (99999 bytes) at... Signed-off-by: Bernardo Gonzalez Kriegel Work as described. No errors Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- tools/export.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/export.pl b/tools/export.pl index 9bbed0b788..1a055b0719 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -394,6 +394,11 @@ if ( $op eq "export" ) { print "\n"; } else { + my (@result_build_tag) = MARC::File::USMARC::_build_tag_directory($record); + if ($result_build_tag[2] > 99999) { + warn "record (number $recordid) length ".$result_build_tag[2]." is larger than the MARC spec allows (99999 bytes)"; + next; + } print $record->as_usmarc(); } } -- 2.39.5