Bugzilla – Attachment 103006 Details for
Bug 24715
Cache repeatable subfield in TransformKohaToMarc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24715: (QA follow-up) Remove $mss2 tric
Bug-24715-QA-follow-up-Remove-mss2-tric.patch (text/plain), 2.79 KB, created by
Marcel de Rooy
on 2020-04-15 13:52:51 UTC
(
hide
)
Description:
Bug 24715: (QA follow-up) Remove $mss2 tric
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-04-15 13:52:51 UTC
Size:
2.79 KB
patch
obsolete
>From b0a1ba1b58f18ea17bbc1ac0be54f95189a3fb55 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 15 Apr 2020 13:46:50 +0000 >Subject: [PATCH] Bug 24715: (QA follow-up) Remove $mss2 tric >Content-Type: text/plain; charset=utf-8 > >As requested by QA, removing the $mss2 variable. This may lead >to repeated calls to the cache. >--- > C4/Biblio.pm | 23 +++++++++-------------- > 1 file changed, 9 insertions(+), 14 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 01f6d20e50..7db59e4c98 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1991,9 +1991,7 @@ sub TransformKohaToMarc { > # In the next call we use the Default framework, since it is considered > # authoritative for Koha to Marc mappings. > my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # do not change framework >- my $mss2; # belongs to $params->{framework} only filled when needed > my $tag_hr = {}; >- my $need_split; > while ( my ($kohafield, $value) = each %$hash ) { > foreach my $fld ( @{ $mss->{$kohafield} } ) { > my $tagfield = $fld->{tagfield}; >@@ -2001,7 +1999,7 @@ sub TransformKohaToMarc { > next if !$tagfield; > > # BZ 21800: split value if field is repeatable. >- ( $need_split, $mss2 ) = _check_split($params, $mss2, $fld, $value); >+ my $need_split = _check_split($params, $fld, $value); > my @values = $need_split > ? split(/\s?\|\s?/, $value, -1) > : ( $value ); >@@ -2027,24 +2025,21 @@ sub TransformKohaToMarc { > > sub _check_split { > # Checks if $value must be split; may consult passed framework >-# Returns 0|1, and framework hash if consulted >- my ($params, $mss2, $fld, $value) = @_; >- return (0, $mss2) if index($value,'|') == -1; # nothing to worry about >- return (0, $mss2) if $params->{no_split}; >+ my ($params, $fld, $value) = @_; >+ return if index($value,'|') == -1; # nothing to worry about >+ return if $params->{no_split}; > > # if we did not get a specific framework, check default in $mss >- return ( $fld->{repeatable}, $mss2) if !$params->{framework}; >+ return $fld->{repeatable} if !$params->{framework}; > > # here we need to check the specific framework >- if(!$mss2) { >- $mss2 = GetMarcSubfieldStructure($params->{framework}, { unsafe => 1 }); >- } >- foreach my $fld2 ( @{ $mss2->{ $fld->{kohafield} } } ) { >+ my $mss = GetMarcSubfieldStructure($params->{framework}, { unsafe => 1 }); >+ foreach my $fld2 ( @{ $mss->{ $fld->{kohafield} } } ) { > next if $fld2->{tagfield} ne $fld->{tagfield}; > next if $fld2->{tagsubfield} ne $fld->{tagsubfield}; >- return (1, $mss2) if $fld2->{repeatable}; >+ return 1 if $fld2->{repeatable}; > } >- return (0, $mss2); >+ return; > } > > =head2 PrepHostMarcField >-- >2.11.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 24715
:
99514
|
99515
|
99516
|
99699
|
102992
|
102993
|
103005
|
103006
|
103010