Bugzilla – Attachment 157176 Details for
Bug 27943
MARC21 authorities not support 7XX on display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27943: (QA follow-up) Perltidy
Bug-27943-QA-follow-up-Perltidy.patch (text/plain), 10.30 KB, created by
Katrin Fischer
on 2023-10-14 23:13:30 UTC
(
hide
)
Description:
Bug 27943: (QA follow-up) Perltidy
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-10-14 23:13:30 UTC
Size:
10.30 KB
patch
obsolete
>From 36d11af69a4d30170b4d386c964702300fdb59e5 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Sat, 14 Oct 2023 21:48:42 +0000 >Subject: [PATCH] Bug 27943: (QA follow-up) Perltidy > >I have some trouble to get the tidyness test on >AuthoritiesMarc.pm passing. There are several outstanding >patches touching this file, so I didn't dare to perltidy >the whole file just yet. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/AuthoritiesMarc.pm | 136 +++++++++++++++---------------- > t/db_dependent/AuthoritiesMarc.t | 78 +++++++++--------- > 2 files changed, 106 insertions(+), 108 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 67464d826d..6989a6a513 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -991,8 +991,8 @@ sub BuildSummary { > use C4::Heading::MARC21; > my $handler = C4::Heading::MARC21->new(); > my $subfields_to_report; >- my $subfields_to_subdivision=""; >- my $delimiter = C4::Context->preference('AuthoritySeparator'); >+ my $subfields_to_subdivision = ""; >+ my $delimiter = C4::Context->preference('AuthoritySeparator'); > > foreach my $field ($record->field('1..')) { > my $tag = $field->tag(); >@@ -1071,70 +1071,68 @@ sub BuildSummary { > push @notes, { note => $field->as_string(), field => $field->tag() }; > } > >- foreach my $field ($record->field('7..')) >- { >- my $tag = $field->tag(); >- >- if ($tag eq '700') { >- $subfields_to_report = 'abcdefghjklmnopqrst'; >- $subfields_to_subdivision='vxyz'; >- } elsif ($tag eq '710') { >- $subfields_to_report = 'abcdefghklmnoprst'; >- $subfields_to_subdivision='vxyz'; >- } elsif ($tag eq '711') { >- $subfields_to_report = 'acdefghklnpqst'; >- $subfields_to_subdivision='vxyz'; >- } elsif ($tag eq '730') { >- $subfields_to_report = 'adfghklmnoprst'; >- $subfields_to_subdivision='vxyz'; >- } elsif ($tag eq '748') { >- $subfields_to_report = 'ab'; >- $subfields_to_subdivision='vxyz'; >- } elsif ($tag eq '750') { >- $subfields_to_report = 'ab'; >- $subfields_to_subdivision='vxyz'; >- } elsif ($tag eq '751') { >- $subfields_to_report = 'a'; >- $subfields_to_subdivision='vxyz'; >- } elsif ($tag eq '755') { >- $subfields_to_report = 'abvxyz'; >- $subfields_to_subdivision='vxyz'; >- } elsif ($tag eq '780') { >- $subfields_to_report = 'vxyz'; >- $delimiter=" "; >- } elsif ($tag eq '781') { >- $subfields_to_report = 'vxyz'; >- $delimiter=" "; >- } elsif ($tag eq '782') { >- $subfields_to_report = 'vxyz'; >- $delimiter=" "; >- } elsif ($tag eq '785') { >- $subfields_to_report = 'vxyz'; >- $delimiter=" "; >- } >+ foreach my $field ( $record->field('7..') ) { >+ my $tag = $field->tag(); >+ >+ if ( $tag eq '700' ) { >+ $subfields_to_report = 'abcdefghjklmnopqrst'; >+ $subfields_to_subdivision = 'vxyz'; >+ } elsif ( $tag eq '710' ) { >+ $subfields_to_report = 'abcdefghklmnoprst'; >+ $subfields_to_subdivision = 'vxyz'; >+ } elsif ( $tag eq '711' ) { >+ $subfields_to_report = 'acdefghklnpqst'; >+ $subfields_to_subdivision = 'vxyz'; >+ } elsif ( $tag eq '730' ) { >+ $subfields_to_report = 'adfghklmnoprst'; >+ $subfields_to_subdivision = 'vxyz'; >+ } elsif ( $tag eq '748' ) { >+ $subfields_to_report = 'ab'; >+ $subfields_to_subdivision = 'vxyz'; >+ } elsif ( $tag eq '750' ) { >+ $subfields_to_report = 'ab'; >+ $subfields_to_subdivision = 'vxyz'; >+ } elsif ( $tag eq '751' ) { >+ $subfields_to_report = 'a'; >+ $subfields_to_subdivision = 'vxyz'; >+ } elsif ( $tag eq '755' ) { >+ $subfields_to_report = 'abvxyz'; >+ $subfields_to_subdivision = 'vxyz'; >+ } elsif ( $tag eq '780' ) { >+ $subfields_to_report = 'vxyz'; >+ $delimiter = " "; >+ } elsif ( $tag eq '781' ) { >+ $subfields_to_report = 'vxyz'; >+ $delimiter = " "; >+ } elsif ( $tag eq '782' ) { >+ $subfields_to_report = 'vxyz'; >+ $delimiter = " "; >+ } elsif ( $tag eq '785' ) { >+ $subfields_to_report = 'vxyz'; >+ $delimiter = " "; >+ } > >- my $heading = $field->as_string($subfields_to_report); >+ my $heading = $field->as_string($subfields_to_report); > >- my $subheading = $field->as_string($subfields_to_subdivision,$delimiter); >- if(length $subheading > 0 ) >- { >- $heading.=$delimiter.$subheading; >- } >+ my $subheading = $field->as_string( $subfields_to_subdivision, $delimiter ); >+ if ( length $subheading > 0 ) { >+ $heading .= $delimiter . $subheading; >+ } > >- if ($subfields_to_report) { >- push @equalterm, { >- heading => $heading, >- hemain => ( $field->subfield( substr($subfields_to_report, 0, 1) ) // undef ), >- field => $tag, >- }; >- } else { >- push @equalterm, { >- heading => $field->as_string(), >- hemain => ( $field->subfield( 'a' ) // undef ), >- field => $tag, >- }; >- } >+ if ($subfields_to_report) { >+ push @equalterm, { >+ heading => $heading, >+ hemain => ( $field->subfield( substr( $subfields_to_report, 0, 1 ) ) // undef ), >+ field => $tag, >+ }; >+ } else { >+ push @equalterm, { >+ heading => $field->as_string(), >+ hemain => ( $field->subfield('a') // undef ), >+ field => $tag, >+ }; > } >+ } > > foreach my $field ($record->field('880')) { > my $linkage = $field->subfield('6'); >@@ -1156,14 +1154,14 @@ sub BuildSummary { > push @otherscript, { term => $field->as_string($subfields_to_report), category => $category, type => $type, direction => $direction, linkage => $linkage }; > } > } >- $summary{mainentry} = $authorized[0]->{heading}; >+ $summary{mainentry} = $authorized[0]->{heading}; > $summary{mainmainentry} = $authorized[0]->{hemain}; >- $summary{authorized} = \@authorized; >- $summary{notes} = \@notes; >- $summary{seefrom} = \@seefrom; >- $summary{seealso} = \@seealso; >- $summary{otherscript} = \@otherscript; >- $summary{equalterm} = \@equalterm; >+ $summary{authorized} = \@authorized; >+ $summary{notes} = \@notes; >+ $summary{seefrom} = \@seefrom; >+ $summary{seealso} = \@seealso; >+ $summary{otherscript} = \@otherscript; >+ $summary{equalterm} = \@equalterm; > return \%summary; > } > >diff --git a/t/db_dependent/AuthoritiesMarc.t b/t/db_dependent/AuthoritiesMarc.t >index 2bb69ba36c..5f5c86f2c6 100755 >--- a/t/db_dependent/AuthoritiesMarc.t >+++ b/t/db_dependent/AuthoritiesMarc.t >@@ -130,32 +130,33 @@ $dbh->do(q{ > t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); > my $expected_marc21_summary = { > 'authorized' => [ >- { >- 'field' => '151', >- 'heading' => 'New York (State)', >- 'hemain' => 'New York (State)' >- } >- ], >- 'authtypecode' => 'GEOGR_NAME', >- 'mainentry' => 'New York (State)', >+ { >+ 'field' => '151', >+ 'heading' => 'New York (State)', >+ 'hemain' => 'New York (State)' >+ } >+ ], >+ 'authtypecode' => 'GEOGR_NAME', >+ 'mainentry' => 'New York (State)', > 'mainmainentry' => 'New York (State)', >- 'notes' => [], >- 'otherscript' => [], >- 'seealso' => [ >- { >- 'authid' => '1', >- 'field' => '551', >- 'heading' => 'United States', >- 'hemain' => 'United States', >- 'search' => 'United States', >- 'type' => 'broader' >- } >- ], >- 'seefrom' => [], >- 'label' => 'Geographic Name', >- 'type' => 'Geographic Name', >+ 'notes' => [], >+ 'otherscript' => [], >+ 'seealso' => [ >+ { >+ 'authid' => '1', >+ 'field' => '551', >+ 'heading' => 'United States', >+ 'hemain' => 'United States', >+ 'search' => 'United States', >+ 'type' => 'broader' >+ } >+ ], >+ 'seefrom' => [], >+ 'label' => 'Geographic Name', >+ 'type' => 'Geographic Name', > 'equalterm' => [] > }; >+ > is_deeply( > BuildSummary(C4::AuthoritiesMarc::GetAuthority(2), 2, 'GEOGR_NAME'), > $expected_marc21_summary, >@@ -183,23 +184,22 @@ $unimarc_name_auth->add_fields( > ); > my $expected_unimarc_name_summary = { > 'authorized' => [ >- { >- 'field' => '200', >- 'heading' => 'Fossey Brigitte', >- 'hemain' => 'Fossey' >- } >- ], >- 'authtypecode' => 'NP', >- 'mainentry' => 'Fossey Brigitte', >+ { >+ 'field' => '200', >+ 'heading' => 'Fossey Brigitte', >+ 'hemain' => 'Fossey' >+ } >+ ], >+ 'authtypecode' => 'NP', >+ 'mainentry' => 'Fossey Brigitte', > 'mainmainentry' => 'Fossey', >- 'notes' => [], >- 'otherscript' => [], >- 'seealso' => [], >- 'seefrom' => [], >- 'summary' => 'Fossey, Brigitte', >- 'type' => 'Auteur', >- 'equalterm' => [] >- >+ 'notes' => [], >+ 'otherscript' => [], >+ 'seealso' => [], >+ 'seefrom' => [], >+ 'summary' => 'Fossey, Brigitte', >+ 'type' => 'Auteur', >+ 'equalterm' => [] > }; > > is_deeply( >-- >2.30.2
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 27943
:
122549
|
132778
|
133712
|
146945
|
154502
|
157173
|
157174
|
157175
| 157176 |
157177