Bug 11413: Fix return for ModifyRecordWithTemplate
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 12 Dec 2013 20:14:24 +0000 (21:14 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 14 Nov 2014 15:05:46 +0000 (12:05 -0300)
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 <brendan@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/MarcModificationTemplates.pm
t/db_dependent/MarcModificationTemplates.t

index 3465f5c..f0cccda 100644 (file)
@@ -626,6 +626,8 @@ sub ModifyRecordWithTemplate {
 
         warn( $record->as_formatted() ) if DEBUG >= 10;
     }
+
+    return;
 }
 1;
 __END__
index c41b76a..e8bfcbc 100644 (file)
@@ -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');