Bugzilla – Attachment 23504 Details for
Bug 11395
Batch modifications for records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11395: Fix return for ModifyRecordWithTemplate
Bug-11395-Fix-return-for-ModifyRecordWithTemplate.patch (text/plain), 2.11 KB, created by
Jonathan Druart
on 2013-12-13 10:37:03 UTC
(
hide
)
Description:
Bug 11395: Fix return for ModifyRecordWithTemplate
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-12-13 10:37:03 UTC
Size:
2.11 KB
patch
obsolete
>From 42323331d1fef84f9d99b37ad571a7f4ecf8ff3a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >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. >--- > C4/MarcModificationTemplates.pm | 4 +++- > t/db_dependent/MarcModificationTemplates.t | 6 ++---- > 2 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm >index f143acd..f8d06c1 100644 >--- a/C4/MarcModificationTemplates.pm >+++ b/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 ); > } > >@@ -627,6 +627,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 04ff80a..e58c1c0 100644 >--- a/t/db_dependent/MarcModificationTemplates.t >+++ b/t/db_dependent/MarcModificationTemplates.t >@@ -1,6 +1,6 @@ > use Modern::Perl; > >-use Test::More tests => 74; >+use Test::More tests => 75; > > use_ok("MARC::Field"); > use_ok("MARC::Record"); >@@ -183,13 +183,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'); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11395
:
23502
|
23503
|
23504
|
23505
|
23506
|
23507
|
23508
|
23592
|
24634
|
26072
|
26981
|
28978
|
28999
|
29000
|
29001
|
29002
|
29003
|
29004
|
29056
|
29509
|
29569
|
31344
|
32181
|
32182
|
32184
|
32239
|
32240
|
32241
|
32242
|
32243
|
32244
|
32245
|
32246
|
32247
|
32248
|
32249
|
33145
|
33146
|
33147
|
33148
|
33149
|
33150
|
33151
|
33152
|
33153
|
33154
|
33155
|
34393
|
34394
|
34395
|
34396
|
34397
|
34398
|
34399
|
34400
|
34401
|
34402
|
34552
|
34553
|
34554
|
34555
|
34556
|
34557
|
34558
|
34559
|
34560
|
34561
|
34562
|
35783
|
35784
|
35785
|
35786
|
35787
|
35788
|
35789
|
35790
|
35791
|
35792
|
36295
|
36296
|
36297
|
36298
|
36299
|
36300
|
36301
|
36302
|
36303
|
36304