From 62ae451025338db66555b18b86bd602290cfb272 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 29 Jan 2015 16:18:19 +0100 Subject: [PATCH] Bug 12860: the export tools explodes if a field is not exported To reproduce: 1/ Go on tools/export.pl 2/ Export some records and specify you don't want the fields 245 (the whole field, do not specify a subfield). 3/ Export, BOOM Software error: Arguments must be MARC::Field object at /home/koha/src/tools/export.pl line 400. Test plan: Apply the patch and confirm the fields 245 are not exported and the export works as expected. Signed-off-by: Robin Sheat Export fails to asplode with this patch --- tools/export.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/export.pl b/tools/export.pl index b079e1c..1bee5dc 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -393,7 +393,7 @@ if ( $op eq "export" ) { } } else { - $record->delete_fields($field); + $record->delete_fields($record->field($field)); } } } -- 2.1.0