View | Details | Raw Unified | Return to bug 11395
Collapse All | Expand All

(-)a/C4/MarcModificationTemplates.pm (-1 / +3 lines)
Lines 81-87 sub GetModificationTemplates { Link Here
81
81
82
  my @templates;
82
  my @templates;
83
  while ( my $template = $sth->fetchrow_hashref() ) {
83
  while ( my $template = $sth->fetchrow_hashref() ) {
84
    $template->{'selected'} = 1 if ( $template->{'template_id'} eq $template_id );
84
    $template->{'selected'} = 1 if ( $template_id and $template->{'template_id'} eq $template_id );
85
    push( @templates, $template );
85
    push( @templates, $template );
86
  }
86
  }
87
87
Lines 627-632 sub ModifyRecordWithTemplate { Link Here
627
627
628
        warn( $record->as_formatted() ) if DEBUG >= 10;
628
        warn( $record->as_formatted() ) if DEBUG >= 10;
629
    }
629
    }
630
631
    return;
630
}
632
}
631
1;
633
1;
632
__END__
634
__END__
(-)a/t/db_dependent/MarcModificationTemplates.t (-5 / +2 lines)
Lines 1-6 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
use Test::More tests => 74;
3
use Test::More tests => 75;
4
4
5
use_ok("MARC::Field");
5
use_ok("MARC::Field");
6
use_ok("MARC::Record");
6
use_ok("MARC::Record");
Lines 183-195 is( AddModificationTemplateAction( Link Here
183
183
184
my $record = new_record();
184
my $record = new_record();
185
185
186
ModifyRecordWithTemplate( $template_id, $record );
186
is( ModifyRecordWithTemplate( $template_id, $record ), undef, "The ModifyRecordWithTemplate returns undef" );
187
187
188
my $expected_record = expected_record();
188
my $expected_record = expected_record();
189
is_deeply( $record, $expected_record );
189
is_deeply( $record, $expected_record );
190
190
191
done_testing;
192
193
sub new_record {
191
sub new_record {
194
    my $record = MARC::Record->new;
192
    my $record = MARC::Record->new;
195
    $record->leader('03174nam a2200445 a 4500');
193
    $record->leader('03174nam a2200445 a 4500');
196
- 

Return to bug 11395