Bugzilla – Attachment 22285 Details for
Bug 8015
Add MARC Modifications Templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8015: Remove references to C4::Koha::Log
Bug-8015-Remove-references-to-C4KohaLog.patch (text/plain), 8.34 KB, created by
Kyle M Hall (khall)
on 2013-10-22 16:24:36 UTC
(
hide
)
Description:
Bug 8015: Remove references to C4::Koha::Log
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-10-22 16:24:36 UTC
Size:
8.34 KB
patch
obsolete
>From 1fa83fd2d11a967a94e8bab293efc6190b74841d Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 22 Oct 2013 12:24:10 -0400 >Subject: [PATCH] Bug 8015: Remove references to C4::Koha::Log > >--- > C4/Koha.pm | 16 ---------------- > C4/MarcModificationTemplates.pm | 16 ---------------- > Koha/SimpleMARC.pm | 13 +------------ > 3 files changed, 1 insertions(+), 44 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 0e6d033..c5b32a6 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -1488,22 +1488,6 @@ sub _isbn_cleanup { > return; > } > >-=head2 Log( $message ); >- >- Writes data to /tmp/koha.log. >- >- This is useful for debugging forked processes >- that do not write to the apache error log >- >-=cut >- >-sub Log { >- my ($data) = @_; >- warn $data; >- open my $fh, '>>', '/tmp/koha.log'; >- print $fh "$data\n"; >- close $fh; >-} > 1; > > __END__ >diff --git a/C4/MarcModificationTemplates.pm b/C4/MarcModificationTemplates.pm >index d26b76d..f504621 100644 >--- a/C4/MarcModificationTemplates.pm >+++ b/C4/MarcModificationTemplates.pm >@@ -17,11 +17,6 @@ package C4::MarcModificationTemplates; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-## NOTE: >-## Parts of this module are used from cgi scripts that are detached from apache before >-## execution. For this reason, the C4::Koha::Log function has been used to capture >-## output for debugging purposes. >- > use Modern::Perl; > > use DateTime; >@@ -78,7 +73,6 @@ files telling Koha what fields to insert data into. > > sub GetModificationTemplates { > my ( $template_id ) = @_; >- C4::Koha::Log("C4::MarcModificationTemplates::GetModificationTemplates( $template_id )") if DEBUG; > warn("C4::MarcModificationTemplates::GetModificationTemplates( $template_id )") if DEBUG; > > my $dbh = C4::Context->dbh; >@@ -185,7 +179,6 @@ sub GetModificationTemplateAction { > sub GetModificationTemplateActions { > my ( $template_id ) = @_; > >- C4::Koha::Log( "C4::MarcModificationTemplates::GetModificationTemplateActions( $template_id )" ) if DEBUG; > warn( "C4::MarcModificationTemplates::GetModificationTemplateActions( $template_id )" ) if DEBUG; > > my $dbh = C4::Context->dbh; >@@ -197,7 +190,6 @@ sub GetModificationTemplateActions { > push( @actions, $action ); > } > >- C4::Koha::Log( Data::Dumper::Dumper( @actions ) ) if DEBUG > 4; > warn( Data::Dumper::Dumper( @actions ) ) if DEBUG > 4; > > return @actions; >@@ -241,10 +233,6 @@ sub AddModificationTemplateAction { > $description > ) = @_; > >- C4::Koha::Log( "C4::MarcModificationTemplates::AddModificationTemplateAction( $template_id, $action, >- $field_number, $from_field, $from_subfield, $field_value, $to_field, $to_subfield, >- $to_regex_search, $to_regex_replace, $to_regex_modifiers, $conditional, $conditional_field, $conditional_subfield, $conditional_comparison, >- $conditional_value, $conditional_regex, $description )" ) if DEBUG; > warn( "C4::MarcModificationTemplates::AddModificationTemplateAction( $template_id, $action, > $field_number, $from_field, $from_subfield, $field_value, $to_field, $to_subfield, > $to_regex_search, $to_regex_replace, $to_regex_modifiers, $conditional, $conditional_field, $conditional_subfield, $conditional_comparison, >@@ -485,7 +473,6 @@ sub MoveModificationTemplateAction { > > sub ModifyRecordsWithTemplate { > my ( $template_id, $batch ) = @_; >- C4::Koha::Log( "C4::MarcModificationTemplates::ModifyRecordsWithTemplate( $template_id, $batch )" ) if DEBUG; > warn( "C4::MarcModificationTemplates::ModifyRecordsWithTemplate( $template_id, $batch )" ) if DEBUG; > > while ( my $record = $batch->next() ) { >@@ -504,9 +491,7 @@ sub ModifyRecordsWithTemplate { > > sub ModifyRecordWithTemplate { > my ( $template_id, $record ) = @_; >- C4::Koha::Log( "C4::MarcModificationTemplates::ModifyRecordWithTemplate( $template_id, $record )" ) if DEBUG; > warn( "C4::MarcModificationTemplates::ModifyRecordWithTemplate( $template_id, $record )" ) if DEBUG; >- C4::Koha::Log( "Unmodified Record:\n" . $record->as_formatted() ) if DEBUG >= 10; > warn( "Unmodified Record:\n" . $record->as_formatted() ) if DEBUG >= 10; > > my $current_date = DateTime->now()->ymd(); >@@ -607,7 +592,6 @@ sub ModifyRecordWithTemplate { > } > } > >- C4::Koha::Log( $record->as_formatted() ) if DEBUG >= 10; > warn( $record->as_formatted() ) if DEBUG >= 10; > } > } >diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm >index bd4c35e..2195143 100644 >--- a/Koha/SimpleMARC.pm >+++ b/Koha/SimpleMARC.pm >@@ -31,7 +31,7 @@ our $debug = 0; > > =head1 NAME > >-SimpleMARC - Perl modle for making simple MARC record alterations. >+SimpleMARC - Perl module for making simple MARC record alterations. > > =head1 SYNOPSIS > >@@ -74,13 +74,11 @@ at your option, any later version of Perl 5 you may have available. > > sub copy_field { > my ( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName, $regex, $n, $dont_erase ) = @_; >- C4::Koha::Log( "C4::SimpleMARC::copy_field( '$record', '$fromFieldName', '$fromSubfieldName', '$toFieldName', '$toSubfieldName', '$regex', '$n' )" ) if $debug; > > if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; } > > my @values = read_field( $record, $fromFieldName, $fromSubfieldName ); > @values = ( $values[$n-1] ) if ( $n ); >- C4::Koha::Log( "@values = read_field( $record, $fromFieldName, $fromSubfieldName )" ) if $debug >= 3; > > if ( $regex and $regex->{search} ) { > $regex->{modifiers} //= q||; >@@ -91,7 +89,6 @@ sub copy_field { > if grep {/$modifier/} @available_modifiers; > } > foreach my $value ( @values ) { >- C4::Koha::Log( "\$value =~ s/$regex->{search}/$regex->{replace}/$modifiers" ) if ( $debug >= 3 ); > for ( $modifiers ) { > when ( /^(ig|gi)$/ ) { > $value =~ s/$regex->{search}/$regex->{replace}/ig; >@@ -127,7 +124,6 @@ sub copy_field { > > sub update_field { > my ( $record, $fieldName, $subfieldName, $dont_erase, @values ) = @_; >- C4::Koha::Log( "C4::SimpleMARC::update_field( $record, $fieldName, $subfieldName, $dont_erase, @values )" ) if $debug; > > if ( ! ( $record && $fieldName ) ) { return; } > >@@ -186,7 +182,6 @@ sub update_field { > > sub read_field { > my ( $record, $fieldName, $subfieldName, $n ) = @_; >- C4::Koha::Log( "C4::SimpleMARC::read_field( '$record', '$fieldName', '$subfieldName', '$n' )" ) if $debug; > > my @fields = $record->field( $fieldName ); > >@@ -215,7 +210,6 @@ sub read_field { > > sub field_exists { > my ( $record, $fieldName, $subfieldName ) = @_; >- C4::Koha::Log( "C4::SimpleMARC::field_exists( $record, $fieldName, $subfieldName )" ) if $debug; > > if ( ! $record ) { return; } > >@@ -226,7 +220,6 @@ sub field_exists { > $return = $record->field( $fieldName ) && 1; > } > >- C4::Koha::Log( "C4:SimpleMARC::field_exists: Returning '$return'" ) if $debug >= 2; > return $return; > } > >@@ -247,7 +240,6 @@ sub field_exists { > sub field_equals { > my ( $record, $value, $fieldName, $subfieldName, $regex, $n ) = @_; > $n = 1 unless ( $n ); ## $n defaults to first field of a repeatable field series >- C4::Koha::Log( "C4::SimpleMARC::field_equals( '$record', '$value', '$fieldName', '$subfieldName', '$regex', '$n')" ) if $debug; > > if ( ! $record ) { return; } > >@@ -255,7 +247,6 @@ sub field_equals { > my $field_value = $field_values[$n-1]; > > if ( $regex ) { >- C4::Koha::Log( "Testing '$field_value' =~ m/$value/" ) if $debug >= 3; > return $field_value =~ m/$value/; > } else { > return $field_value eq $value; >@@ -277,7 +268,6 @@ sub field_equals { > > sub move_field { > my ( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName, $regex, $n ) = @_; >- C4::Koha::Log( "C4::SimpleMARC::move_field( '$record', '$fromFieldName', '$fromSubfieldName', '$toFieldName', '$toSubfieldName', '$regex', '$n' )" ) if $debug; > copy_field( $record, $fromFieldName, $fromSubfieldName, $toFieldName, $toSubfieldName, $regex, $n , 'dont_erase' ); > delete_field( $record, $fromFieldName, $fromSubfieldName, $n ); > } >@@ -295,7 +285,6 @@ sub move_field { > > sub delete_field { > my ( $record, $fieldName, $subfieldName, $n ) = @_; >- C4::Koha::Log( "C4::SimpleMARC::delete_field( '$record', '$fieldName', '$subfieldName', '$n' )" ) if $debug; > > my @fields = $record->field( $fieldName ); > >-- >1.7.2.5
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 8015
:
9313
|
9329
|
9330
|
9331
|
10089
|
11579
|
11607
|
11608
|
12280
|
12288
|
12569
|
12570
|
12571
|
12572
|
12839
|
12856
|
12857
|
12858
|
12859
|
12860
|
13121
|
13138
|
13495
|
14030
|
14031
|
14032
|
14033
|
14034
|
14035
|
14040
|
16330
|
16331
|
16332
|
16333
|
16334
|
16335
|
16363
|
16376
|
16377
|
16378
|
16379
|
16413
|
16415
|
16423
|
16455
|
16468
|
16470
|
16471
|
16472
|
16473
|
16475
|
16476
|
16477
|
16478
|
16479
|
16480
|
17036
|
17037
|
17038
|
18372
|
18441
|
21024
|
21025
|
21026
|
21027
|
21028
|
21029
|
21030
|
21031
|
21032
|
21033
|
21034
|
21035
|
21036
|
21037
|
21038
|
21371
|
21484
|
21485
|
21486
|
21487
|
21808
|
21809
|
21876
|
21901
|
21902
|
21903
|
21904
|
21905
|
21906
|
21907
|
21908
|
21909
|
21910
|
21911
|
21912
|
21913
|
21914
|
21915
|
21916
|
21917
|
21918
|
21919
|
21920
|
22185
|
22186
|
22187
|
22188
|
22189
|
22190
|
22284
|
22285
|
22290
|
22293
|
22392
|
22393
|
22394
|
22395
|
22396
|
22397
|
22398
|
22399
|
22400
|
22401