From dbc39e40a49ee01f14bf92c251b4895575e90152 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 Signed-off-by: Kyle M Hall Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit e2968fe0812898d92ce8c63e9c7f0dedd244acc9) Signed-off-by: Chris Cormack --- tools/export.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/export.pl b/tools/export.pl index bae69410be..16bfcfeefc 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -394,7 +394,7 @@ if ( $op eq "export" ) { } } else { - $record->delete_fields($field); + $record->delete_fields($record->field($field)); } } } -- 2.39.5