Bugzilla – Attachment 166821 Details for
Bug 35989
Searching Geographic authorities generates error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35989: Stop geographic authority searches crashing
Bug-35989-Stop-geographic-authority-searches-crash.patch (text/plain), 2.13 KB, created by
Nick Clemens (kidclamp)
on 2024-05-16 12:39:28 UTC
(
hide
)
Description:
Bug 35989: Stop geographic authority searches crashing
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-05-16 12:39:28 UTC
Size:
2.13 KB
patch
obsolete
>From aa1c02da68257abf3fc93784bb393e01cb48224e Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 16 May 2024 09:33:34 +0000 >Subject: [PATCH] Bug 35989: Stop geographic authority searches crashing > >Currently when searching for a geographic authority record the search will fail if the record has a heading in a 78X field. The system tries to do a regex match against an undefined variable causing an error. This patch makes that regex match conditional on the variable being defined to allow the search to succeed. > >Test plan: >1) Navigate to Authorities >2) In the search bar at the top of the page, click on the dropdown options and in the 'Authority type' field, select 'Geographic Name' >3) Click search >4) You should have a list of authorities >5) Click on any authority record and then click edit and select to edit the record >6) Click on the "7" button >7) Click on the green text next to the '781' field to get the list of fields >8) In field 'v' enter any string you like >9) Click save >10) Repeat steps 1-3, this time it should display an error message for an Unmatched [ in regex >11) Apply patch >12) restart_all >13) Refresh the page, the results should show and the string you entered in the 'v' field should display on the record you edited > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/AuthoritiesMarc.pm | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index b595230c5d3..ecc8c53d420 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -1138,9 +1138,11 @@ sub BuildSummary { > > my $heading = $field->as_string($subfields_to_report); > >- my $subheading = $field->as_string( $subfields_to_subdivision, $delimiter ); >- if ( length $subheading > 0 ) { >- $heading .= $delimiter . $subheading; >+ if ($subfields_to_subdivision) { >+ my $subheading = $field->as_string( $subfields_to_subdivision, $delimiter ); >+ if ( length $subheading > 0 ) { >+ $heading .= $delimiter . $subheading; >+ } > } > > if ($subfields_to_report) { >-- >2.39.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 35989
:
166811
|
166821
|
167244
|
167245
|
167267
|
167422
|
167423
|
167424