@@ -, +, @@ prove t/db_dependent/MarcModificationTemplates.t --- C4/MarcModificationTemplates.pm | 4 +++- t/db_dependent/MarcModificationTemplates.t | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) --- a/C4/MarcModificationTemplates.pm +++ a/C4/MarcModificationTemplates.pm @@ -81,7 +81,7 @@ sub GetModificationTemplates { my @templates; while ( my $template = $sth->fetchrow_hashref() ) { - $template->{'selected'} = 1 if ( $template->{'template_id'} eq $template_id ); + $template->{'selected'} = 1 if ( $template_id and $template->{'template_id'} eq $template_id ); push( @templates, $template ); } @@ -624,6 +624,8 @@ sub ModifyRecordWithTemplate { warn( $record->as_formatted() ) if DEBUG >= 10; } + + return; } 1; __END__ --- a/t/db_dependent/MarcModificationTemplates.t +++ a/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 ); -done_testing; - sub new_record { my $record = MARC::Record->new; $record->leader('03174nam a2200445 a 4500'); --