Bugzilla – Attachment 173988 Details for
Bug 33348
Show authority heading use with Elasticsearch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33348: (follow-up) Fix if no 008 defined
Bug-33348-follow-up-Fix-if-no-008-defined.patch (text/plain), 3.68 KB, created by
Thomas Klausner
on 2024-11-05 16:23:27 UTC
(
hide
)
Description:
Bug 33348: (follow-up) Fix if no 008 defined
Filename:
MIME Type:
Creator:
Thomas Klausner
Created:
2024-11-05 16:23:27 UTC
Size:
3.68 KB
patch
obsolete
>From 6e8ca8d4bea76cba1d6e712b5e219f2ea3483d91 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 1 May 2023 22:38:57 +0000 >Subject: [PATCH] Bug 33348: (follow-up) Fix if no 008 defined > >And copy fix across to Zebra search as well. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Thomas Klausner <domm@plix.at> >--- > C4/AuthoritiesMarc.pm | 20 ++++++++++---------- > Koha/SearchEngine/Elasticsearch/Search.pm | 16 +++++++++------- > 2 files changed, 19 insertions(+), 17 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 1656a2ba9b..4fe55cd34b 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -323,17 +323,17 @@ sub SearchAuthorities { > if ( C4::Context->preference('ShowHeadingUse') ) { > # checking valid heading use > my $f008 = $authrecord->field('008'); >- my $pos14to16 = substr( $f008->data, 14, 3 ); >- my $main = substr( $pos14to16, 0, 1 ); >- $newline{main} = 1 if $main eq 'a'; >- my $subject = substr( $pos14to16, 1, 1); >- $newline{subject} = 1 if $subject eq 'a'; >- my $series = substr( $pos14to16, 2, 1 ); >- $newline{series} = 1 if $series eq 'a'; >+ if ($f008) { >+ my $pos14to16 = substr( $f008->data, 14, 3 ); >+ my $main = substr( $pos14to16, 0, 1 ); >+ $newline{main} = 1 if $main eq 'a'; >+ my $subject = substr( $pos14to16, 1, 1 ); >+ $newline{subject} = 1 if $subject eq 'a'; >+ my $series = substr( $pos14to16, 2, 1 ); >+ $newline{series} = 1 if $series eq 'a'; >+ } > } >- >- $newline{authtype} = defined($thisauthtype) ? >- $thisauthtype->authtypetext : ''; >+ $newline{authtype} = defined($thisauthtype) ? $thisauthtype->authtypetext : ''; > $newline{summary} = $summary; > $newline{even} = $counter % 2; > $newline{reported_tag} = $reported_tag; >diff --git a/Koha/SearchEngine/Elasticsearch/Search.pm b/Koha/SearchEngine/Elasticsearch/Search.pm >index 32ddb25a62..171c00c729 100644 >--- a/Koha/SearchEngine/Elasticsearch/Search.pm >+++ b/Koha/SearchEngine/Elasticsearch/Search.pm >@@ -257,13 +257,15 @@ sub search_auth_compat { > if ( C4::Context->preference('ShowHeadingUse') ) { > # checking valid heading use > my $f008 = $marc->field('008'); >- my $pos14to16 = substr( $f008->data, 14, 3 ); >- my $main = substr( $pos14to16, 0, 1 ); >- $result{main} = 1 if $main eq 'a'; >- my $subject = substr( $pos14to16, 1, 1); >- $result{subject} = 1 if $subject eq 'a'; >- my $series = substr( $pos14to16, 2, 1 ); >- $result{series} = 1 if $series eq 'a'; >+ if ($f008) { >+ my $pos14to16 = substr( $f008->data, 14, 3 ); >+ my $main = substr( $pos14to16, 0, 1 ); >+ $result{main} = 1 if $main eq 'a'; >+ my $subject = substr( $pos14to16, 1, 1 ); >+ $result{subject} = 1 if $subject eq 'a'; >+ my $series = substr( $pos14to16, 2, 1 ); >+ $result{series} = 1 if $series eq 'a'; >+ } > } > > # Reimplementing BuildSummary is out of scope because it'll be hard >-- >2.39.5
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 33348
:
148791
|
150440
|
150479
|
150481
|
150482
|
152570
|
152571
|
159066
|
171601
|
171602
|
171603
|
171686
|
171687
|
171688
|
171875
|
171876
|
173987
| 173988 |
173989