Bugzilla – Attachment 42283 Details for
Bug 14098
Regression in Marc Modification Templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14098: Remove unedeed subroutines
Bug-14098-Remove-unedeed-subroutines.patch (text/plain), 6.57 KB, created by
Marcel de Rooy
on 2015-09-03 09:35:09 UTC
(
hide
)
Description:
Bug 14098: Remove unedeed subroutines
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-09-03 09:35:09 UTC
Size:
6.57 KB
patch
obsolete
>From 7658871739d3f8c08a1af0fed1c1494021c1798e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@koha-community.org> >Date: Wed, 27 May 2015 13:34:09 +0200 >Subject: [PATCH] Bug 14098: Remove unedeed subroutines >Content-Type: text/plain; charset=utf-8 > >Just some cleaning before to continue, _copy_field and _copy_subfield did not >do anything useful. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/SimpleMARC.pm | 167 +++++++++++++++------------------------------------- > 1 file changed, 48 insertions(+), 119 deletions(-) > >diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm >index 991d8a9..c4e4c51 100644 >--- a/Koha/SimpleMARC.pm >+++ b/Koha/SimpleMARC.pm >@@ -85,68 +85,32 @@ sub copy_field { > if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; } > > >- if ( not $fromSubfieldName or $fromSubfieldName eq '' >- or not $toSubfieldName or $toSubfieldName eq '' >- ) { >- _copy_field({ >- record => $record, >- from_field => $fromFieldName, >- to_field => $toFieldName, >- regex => $regex, >- field_numbers => $field_numbers, >- }); >+ if ( not $fromSubfieldName >+ or $fromSubfieldName eq '' >+ or not $toSubfieldName >+ or $toSubfieldName eq '' ) { >+ _copy_move_field( >+ { record => $record, >+ from_field => $fromFieldName, >+ to_field => $toFieldName, >+ regex => $regex, >+ field_numbers => $field_numbers, >+ action => 'copy', >+ } >+ ); > } else { >- _copy_subfield({ >- record => $record, >- from_field => $fromFieldName, >- from_subfield => $fromSubfieldName, >- to_field => $toFieldName, >- to_subfield => $toSubfieldName, >- regex => $regex, >- field_numbers => $field_numbers, >- }); >+ _copy_move_subfield( >+ { record => $record, >+ from_field => $fromFieldName, >+ from_subfield => $fromSubfieldName, >+ to_field => $toFieldName, >+ to_subfield => $toSubfieldName, >+ regex => $regex, >+ field_numbers => $field_numbers, >+ action => 'copy', >+ } >+ ); > } >- >-} >- >-sub _copy_field { >- my ( $params ) = @_; >- my $record = $params->{record}; >- my $fromFieldName = $params->{from_field}; >- my $toFieldName = $params->{to_field}; >- my $regex = $params->{regex}; >- my $field_numbers = $params->{field_numbers} // []; >- >- _copy_move_field({ >- record => $record, >- from_field => $fromFieldName, >- to_field => $toFieldName, >- regex => $regex, >- field_numbers => $field_numbers, >- action => 'copy', >- }); >-} >- >-sub _copy_subfield { >- my ( $params ) = @_; >- my $record = $params->{record}; >- my $fromFieldName = $params->{from_field}; >- my $fromSubfieldName = $params->{from_subfield}; >- my $toFieldName = $params->{to_field}; >- my $toSubfieldName = $params->{to_subfield}; >- my $regex = $params->{regex}; >- my $field_numbers = $params->{field_numbers} // []; >- >- _copy_move_subfield({ >- record => $record, >- from_field => $fromFieldName, >- from_subfield => $fromSubfieldName, >- to_field => $toFieldName, >- to_subfield => $toSubfieldName, >- regex => $regex, >- field_numbers => $field_numbers, >- action => 'copy', >- }); > } > > sub update_field { >@@ -416,69 +380,34 @@ sub move_field { > my $regex = $params->{regex}; > my $field_numbers = $params->{field_numbers} // []; > >- if ( not $fromSubfieldName or $fromSubfieldName eq '' >- or not $toSubfieldName or $toSubfieldName eq '' >- ) { >- _move_field({ >- record => $record, >- from_field => $fromFieldName, >- to_field => $toFieldName, >- regex => $regex, >- field_numbers => $field_numbers, >- }); >+ if ( not $fromSubfieldName >+ or $fromSubfieldName eq '' >+ or not $toSubfieldName >+ or $toSubfieldName eq '' ) { >+ _copy_move_field( >+ { record => $record, >+ from_field => $fromFieldName, >+ to_field => $toFieldName, >+ regex => $regex, >+ field_numbers => $field_numbers, >+ action => 'move', >+ } >+ ); > } else { >- _move_subfield({ >- record => $record, >- from_field => $fromFieldName, >- from_subfield => $fromSubfieldName, >- to_field => $toFieldName, >- to_subfield => $toSubfieldName, >- regex => $regex, >- field_numbers => $field_numbers, >- }); >+ _copy_move_subfield( >+ { record => $record, >+ from_field => $fromFieldName, >+ from_subfield => $fromSubfieldName, >+ to_field => $toFieldName, >+ to_subfield => $toSubfieldName, >+ regex => $regex, >+ field_numbers => $field_numbers, >+ action => 'move', >+ } >+ ); > } > } > >-sub _move_field { >- my ( $params ) = @_; >- my $record = $params->{record}; >- my $fromFieldName = $params->{from_field}; >- my $toFieldName = $params->{to_field}; >- my $regex = $params->{regex}; >- my $field_numbers = $params->{field_numbers} // []; >- >- _copy_move_field({ >- record => $record, >- from_field => $fromFieldName, >- to_field => $toFieldName, >- regex => $regex, >- field_numbers => $field_numbers, >- action => 'move', >- }); >-} >- >-sub _move_subfield { >- my ( $params ) = @_; >- my $record = $params->{record}; >- my $fromFieldName = $params->{from_field}; >- my $fromSubfieldName = $params->{from_subfield}; >- my $toFieldName = $params->{to_field}; >- my $toSubfieldName = $params->{to_subfield}; >- my $regex = $params->{regex}; >- my $field_numbers = $params->{field_numbers} // []; >- >- _copy_move_subfield({ >- record => $record, >- from_field => $fromFieldName, >- from_subfield => $fromSubfieldName, >- to_field => $toFieldName, >- to_subfield => $toSubfieldName, >- regex => $regex, >- field_numbers => $field_numbers, >- action => 'move', >- }); >-} >- > =head2 _delete_field > > _delete_field( $record, $fieldName[, $subfieldName [, $n ] ] ); >-- >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 14098
:
39582
|
39583
|
39584
|
39585
|
39610
|
39611
|
39612
|
39613
|
42282
| 42283 |
42284
|
42285