Bugzilla – Attachment 59110 Details for
Bug 17913
Merge three authority merge fixes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 17913: Run perltidy on the inner foreach loop
SIGNED-OFF-Bug-17913-Run-perltidy-on-the-inner-for.patch (text/plain), 4.52 KB, created by
Josef Moravec
on 2017-01-17 21:14:10 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 17913: Run perltidy on the inner foreach loop
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-01-17 21:14:10 UTC
Size:
4.52 KB
patch
obsolete
>From 231ee36f63371d69ed5dec8baa8999c70edd3d4c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 17 Jan 2017 11:59:53 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 17913: Run perltidy on the inner foreach > loop > >Kept the same number of lines. >You could verify with diff -w. > >Test plan: >[1] Run t/db_dependent/Authorities/Merge.t >[2] As the last patch in this series, also test the interface: > Set AuthorityMergeMode to loose. Set dontmerge to Do. > Modify an authority record attached to multiple biblios. > Edit a subfield, clear a subfield and add a subfield. > Save. Wait a bit for the merge and Zebra update. > Verify that the changes are merged properly into biblio records. >[3] Repeat step 2 with AuthorityMergeMode to strict. > Remember that this affects the extra subfields in biblio records. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/AuthoritiesMarc.pm | 50 +++++++++++++++++++++++++------------------------- > 1 file changed, 25 insertions(+), 25 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index e920c01..e3f10f1 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1473,45 +1473,45 @@ sub merge { > : { map { ( $_->[0], 1 ); } ( @record_from, @record_to ) }; > foreach my $marcrecord(@reccache){ > my $update = 0; >- foreach my $tagfield (@$tags_using_authtype){ >- my $countfrom = 0; # used in strict mode to remove duplicates >- foreach my $field ($marcrecord->field($tagfield)){ >- my $auth_number = $field->subfield("9"); # link to authority >- my $tag=$field->tag(); >+ foreach my $tagfield (@$tags_using_authtype) { >+ my $countfrom = 0; # used in strict mode to remove duplicates >+ foreach my $field ( $marcrecord->field($tagfield) ) { >+ my $auth_number = $field->subfield("9"); # link to authority >+ my $tag = $field->tag(); > next if !defined($auth_number) || $auth_number ne $mergefrom; > $countfrom++; >- if( $overwrite && $countfrom > 1 ) { >+ if ( $overwrite && $countfrom > 1 ) { > # remove this duplicate in strict mode >- $marcrecord->delete_field( $field ); >+ $marcrecord->delete_field($field); > $update = 1; > next; > } > my $newtag = $tags_new >- ? _merge_newtag( $tag, $tags_new ) >- : $tag; >- my $field_to = MARC::Field->new( >- $newtag, >- $field->indicator(1), >- $field->indicator(2), >- "9" => $mergeto, >- ); >- foreach my $subfield (grep {$_->[0] ne '9'} @record_to) { >- $field_to->add_subfields($subfield->[0] =>$subfield->[1]); >+ ? _merge_newtag( $tag, $tags_new ) >+ : $tag; >+ my $field_to = MARC::Field->new( >+ $newtag, >+ $field->indicator(1), >+ $field->indicator(2), >+ "9" => $mergeto, >+ ); >+ foreach my $subfield ( grep { $_->[0] ne '9' } @record_to ) { >+ $field_to->add_subfields( $subfield->[0] => $subfield->[1] ); > } >- if( !$overwrite ) { >+ if ( !$overwrite ) { > # add subfields back in loose mode, check skip_subfields > foreach my $subfield ( $field->subfields ) { > next if $skip_subfields->{ $subfield->[0] }; > $field_to->add_subfields( $subfield->[0], $subfield->[1] ); > } > } >- if( $tags_new ) { >- $marcrecord->delete_field( $field ); >- append_fields_ordered( $marcrecord, $field_to ); >- } else { >- $field->replace_with($field_to); >- } >- $update=1; >+ if ($tags_new) { >+ $marcrecord->delete_field($field); >+ append_fields_ordered( $marcrecord, $field_to ); >+ } else { >+ $field->replace_with($field_to); >+ } >+ $update = 1; > } > } > my ($bibliotag,$bibliosubf) = GetMarcFromKohaField("biblio.biblionumber","") ; >-- >2.1.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 17913
:
59009
|
59010
|
59016
|
59017
|
59065
|
59066
|
59073
|
59078
|
59079
|
59080
|
59081
|
59082
|
59083
|
59084
|
59085
|
59089
|
59090
|
59102
|
59103
|
59104
|
59105
|
59106
|
59107
|
59108
|
59109
|
59110
|
59325
|
59326
|
59327
|
59328
|
59329
|
59330
|
59331
|
59332
|
59333
|
59352
|
59358
|
59360
|
59361
|
59362
|
59363
|
59364
|
59365
|
59366
|
59367
|
59368
|
59369
|
59370
|
59411
|
59412
|
59413
|
60042
|
60043
|
60341
|
60342