From b722d303ea299beacf4f27d1da450f3436ef0c33 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 12 Dec 2013 21:14:24 +0100 Subject: [PATCH] Bug 11395: Fix return for ModifyRecordWithTemplate Make sure the ModifyRecordWithTemplate routine returns undef. This patch also removes a warning if GetModificationTemplates is called without parameter. Verify prove t/db_dependent/MarcModificationTemplates.t returns green. Signed-off-by: Brendan Gallagher --- C4/MarcModificationTemplates.pm | 2 ++ t/db_dependent/MarcModificationTemplates.t | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm index 3465f5c..f0cccda 100644 --- a/C4/MarcModificationTemplates.pm +++ b/C4/MarcModificationTemplates.pm @@ -626,6 +626,8 @@ sub ModifyRecordWithTemplate { warn( $record->as_formatted() ) if DEBUG >= 10; } + + return; } 1; __END__ diff --git a/t/db_dependent/MarcModificationTemplates.t b/t/db_dependent/MarcModificationTemplates.t index c41b76a..e8bfcbc 100644 --- a/t/db_dependent/MarcModificationTemplates.t +++ b/t/db_dependent/MarcModificationTemplates.t @@ -1,6 +1,6 @@ use Modern::Perl; -use Test::More tests => 77; +use Test::More tests => 78; use_ok("MARC::Field"); use_ok("MARC::Record"); @@ -208,13 +208,11 @@ is( AddModificationTemplateAction( my $record = new_record(); -ModifyRecordWithTemplate( $template_id, $record ); +is( ModifyRecordWithTemplate( $template_id, $record ), undef, "The ModifyRecordWithTemplate returns undef" ); my $expected_record = expected_record(); is_deeply( $record, $expected_record, "Record modification as expected"); -done_testing; - sub new_record { my $record = MARC::Record->new; $record->leader('03174nam a2200445 a 4500'); -- 2.1.0