Bugzilla – Attachment 69823 Details for
Bug 19820
Add unsafe param to GetMarcSubfieldStructure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19820: Add unsafe param to GetMarcSubfieldStructure
Bug-19820-Add-unsafe-param-to-GetMarcSubfieldStruc.patch (text/plain), 2.89 KB, created by
David Gustafsson
on 2017-12-15 13:24:20 UTC
(
hide
)
Description:
Bug 19820: Add unsafe param to GetMarcSubfieldStructure
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2017-12-15 13:24:20 UTC
Size:
2.89 KB
patch
obsolete
>From a238fc851b17fffe5ffe900e27f5e1ac556bf517 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Fri, 15 Dec 2017 14:19:49 +0100 >Subject: [PATCH] Bug 19820: Add unsafe param to GetMarcSubfieldStructure > >Add unsafe param to GetMarcSubfieldStructure and use this options >where it's safe to do so to increase performance >--- > C4/Biblio.pm | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 03d9a605fb..8c40ec19a8 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -1079,13 +1079,13 @@ sub GetUsedMarcStructure { > =cut > > sub GetMarcSubfieldStructure { >- my ( $frameworkcode ) = @_; >+ my ( $frameworkcode, $params ) = @_; > > $frameworkcode //= ''; > > my $cache = Koha::Caches->get_instance(); > my $cache_key = "MarcSubfieldStructure-$frameworkcode"; >- my $cached = $cache->get_from_cache($cache_key); >+ my $cached = $cache->get_from_cache($cache_key, { unsafe => ($params && $params->{unsafe}) }); > return $cached if $cached; > > my $dbh = C4::Context->dbh; >@@ -1129,7 +1129,7 @@ sub GetMarcFromKohaField { > return unless $kohafield; > # The next call uses the Default framework since it is AUTHORITATIVE > # for all Koha to MARC mappings. >- my $mss = GetMarcSubfieldStructure( '' ); # Do not change framework >+ my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # Do not change framework > my @retval; > foreach( @{ $mss->{$kohafield} } ) { > push @retval, $_->{tagfield}, $_->{tagsubfield}; >@@ -1156,7 +1156,7 @@ sub GetMarcSubfieldStructureFromKohaField { > > # The next call uses the Default framework since it is AUTHORITATIVE > # for all Koha to MARC mappings. >- my $mss = GetMarcSubfieldStructure(''); # Do not change framework >+ my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # Do not change framework > return unless $mss->{$kohafield}; > return wantarray ? @{$mss->{$kohafield}} : $mss->{$kohafield}->[0]; > } >@@ -2188,7 +2188,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( '' ); # do not change framework >+ my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # do not change framewok > my $tag_hr = {}; > while ( my ($kohafield, $value) = each %$hash ) { > foreach my $fld ( @{ $mss->{$kohafield} } ) { >@@ -2601,7 +2601,7 @@ sub TransformMarcToKoha { > > # The next call acknowledges Default as the authoritative framework > # for Koha to MARC mappings. >- my $mss = GetMarcSubfieldStructure(''); # Do not change framework >+ my $mss = GetMarcSubfieldStructure( '', { unsafe => 1 } ); # Do not change framework > foreach my $kohafield ( keys %{ $mss } ) { > my ( $table, $column ) = split /[.]/, $kohafield, 2; > next unless $tables{$table}; >-- >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 19820
:
69823
|
71573
|
74089
|
75251
|
75252