Bugzilla – Attachment 159948 Details for
Bug 35405
MarcAuthorities: Use of uninitialized value $tag in hash element at MARC/Record.pm line 202.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35405: Remove noise from MARC::Record in SearchAuthorities
Bug-35405-Remove-noise-from-MARCRecord-in-SearchAu.patch (text/plain), 1.93 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-12-18 11:39:16 UTC
(
hide
)
Description:
Bug 35405: Remove noise from MARC::Record in SearchAuthorities
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-12-18 11:39:16 UTC
Size:
1.93 KB
patch
obsolete
>From bd0c0b7c73ece98e0ffe3b904bdb4877895e2e66 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 27 Nov 2023 16:12:41 +0100 >Subject: [PATCH] Bug 35405: Remove noise from MARC::Record in > SearchAuthorities > >We are calling ->field with an undef parameter. >MARC::Record does not like that and says: > Use of uninitialized value $tag in hash element at /usr/share/perl5/MARC/Record.pm line 202. >For now, a fix at our side. > >Test plan: >Run SearchAuthorities without passing an authtypecode. >Without this patch, it results in a warning per hit. >With this patch, the noise should be gone. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/AuthoritiesMarc.pm | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 4c593e4eb6e..8c4dde95afe 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -297,12 +297,13 @@ sub SearchAuthorities { > my %newline; > $newline{authid} = $authid; > if ( !$skipmetadata ) { >- my $auth_tag_to_report; >- $auth_tag_to_report = Koha::Authority::Types->find($authtypecode)->auth_tag_to_report >- if $authtypecode; >- my $reported_tag; >- my $mainentry = $authrecord->field($auth_tag_to_report); >+ my ( $auth_tag_to_report, $reported_tag, $mainentry ); >+ if ( $authtypecode ) { >+ $auth_tag_to_report = Koha::Authority::Types->find($authtypecode)->auth_tag_to_report; >+ $mainentry = $authrecord->field($auth_tag_to_report) if $auth_tag_to_report; >+ } > if ($mainentry) { >+ $reported_tag = q{}; > foreach ( $mainentry->subfields() ) { > $reported_tag .= '$' . $_->[0] . $_->[1]; > } >-- >2.43.0
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 35405
:
159274
|
159322
| 159948