Bugzilla – Attachment 186965 Details for
Bug 40883
Authorities display fails on unknown 7XX
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40883: Fix authorities display fails on unknown 7XX
Bug-40883-Fix-authorities-display-fails-on-unknown.patch (text/plain), 2.04 KB, created by
Fridolin Somers
on 2025-09-26 08:52:47 UTC
(
hide
)
Description:
Bug 40883: Fix authorities display fails on unknown 7XX
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2025-09-26 08:52:47 UTC
Size:
2.04 KB
patch
obsolete
>From 943ed73aead0f5c17f81cc494820a86d0fc8bbeb Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Fri, 26 Sep 2025 10:48:05 +0200 >Subject: [PATCH] Bug 40883: Fix authorities display fails on unknown 7XX > >Bug 27943 added MARC21 authorities 7XX on display. >It calls $field->as_string($subfields_to_report). >This fails when authority type is custom (not in C4/Heading/MARC21.pm $auth_heading_fields) >and so field is not in known ones. > >We see in other parts that $subfields_to_report may be emty. >This patch simply creates 7xx heading with $field->as_string() in this case. > >Test plan: >1) Run test : prove t/db_dependent/AuthoritiesMarc.t >2) Create a new autority type with main heading in 199 and field 799 >3) Create a new authority of this type >4) Perform a search to find it >=> Without patch the page retruns the error >Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE ]$/ at /usr/share/perl5/MARC/Field.pm line 643. >--- > C4/AuthoritiesMarc.pm | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 581ab42eca..822f453917 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1176,7 +1176,12 @@ sub BuildSummary { > $delimiter = " "; > } > >- my $heading = $field->as_string($subfields_to_report); >+ my $heading; >+ if ($subfields_to_report) { >+ $heading = $field->as_string($subfields_to_report); >+ } else { >+ $heading = $field->as_string(); >+ } > > if ($subfields_to_subdivision) { > my $subheading = $field->as_string( $subfields_to_subdivision, $delimiter ); >@@ -1193,7 +1198,7 @@ sub BuildSummary { > }; > } else { > push @equalterm, { >- heading => $field->as_string(), >+ heading => $heading, > hemain => ( $field->subfield('a') // undef ), > field => $tag, > }; >-- >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 40883
:
186964
| 186965