Bugzilla – Attachment 156817 Details for
Bug 17385
Add custom export formats for bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17385: (QA follow-up) Add caching
Bug-17385-QA-follow-up-Add-caching.patch (text/plain), 1.88 KB, created by
Hammat wele
on 2023-10-11 11:53:48 UTC
(
hide
)
Description:
Bug 17385: (QA follow-up) Add caching
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2023-10-11 11:53:48 UTC
Size:
1.88 KB
patch
obsolete
>From cc8345594e034a7427102edc4a92ea3dbf042819 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 22 Mar 2019 08:51:05 +0000 >Subject: [PATCH] Bug 17385: (QA follow-up) Add caching > >Performance: We should add caching in CustomXSLTExportList. > >Note: This resolves the lack of an intranet test in the former patch too. > >Test plan: >Run t/db_dependent/XSLT.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/XSLT.pm | 8 ++++++++ > t/db_dependent/XSLT.t | 1 - > 2 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 63746d2a31..753fddada1 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -29,6 +29,7 @@ use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); > use Koha::AuthorisedValues; > use Koha::ItemTypes; > use Koha::RecordProcessor; >+use Koha::Caches; > use Koha::XSLT::Base; > use Koha::Libraries; > use Koha::Recalls; >@@ -419,6 +420,12 @@ sub CustomXSLTExportList { > my $opac = shift; # opac (1) vs intranet (0) > return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /custom/; > >+ # Check the cache first >+ my $cache = Koha::Caches->get_instance; >+ my $key = $opac ? 'CustomXSLTExportListOPAC' : 'CustomXSLTExportListIntra'; >+ my $cached_val = $cache->get_from_cache($key); >+ return $cached_val if $cached_val; >+ > my @tabFiles; > > my $dir = C4::Context->config( $opac ? 'opachtdocs' : 'intrahtdocs') . >@@ -455,6 +462,7 @@ sub CustomXSLTExportList { > push @tabFiles, \%row; > } > } >+ $cache->set_in_cache( $key, [ @tabFiles ] ); > return \@tabFiles; > } > 1; >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index 3c7b312075..5f79b35b13 100755 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -1,4 +1,3 @@ >-original > #!/usr/bin/perl > > # This file is part of Koha. >-- >2.34.1
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 17385
:
55961
|
58308
|
64033
|
64034
|
67357
|
67579
|
74660
|
74661
|
79055
|
79056
|
80675
|
81385
|
81386
|
84388
|
84389
|
84390
|
86875
|
86876
|
86877
|
86878
|
86879
|
86880
|
97076
|
97101
|
97102
|
97103
|
97104
|
97105
|
100289
|
100290
|
100291
|
100292
|
100293
|
100663
|
100670
|
100671
|
100672
|
100673
|
100674
|
100675
|
112671
|
112672
|
112673
|
112674
|
112675
|
112676
|
112677
|
112678
|
112679
|
112680
|
112681
|
112682
|
112956
|
112957
|
112958
|
112959
|
130283
|
130284
|
130285
|
130286
|
130287
|
130691
|
130692
|
130693
|
130694
|
130695
|
131492
|
132488
|
132489
|
132490
|
132491
|
132492
|
132493
|
132581
|
133498
|
133499
|
133500
|
133501
|
133502
|
133503
|
133504
|
138031
|
138032
|
138033
|
138034
|
138035
|
138036
|
138037
|
138082
|
138083
|
138084
|
138085
|
138086
|
138087
|
138088
|
138132
|
139277
|
139278
|
139279
|
139280
|
139281
|
139282
|
139283
|
139284
|
141157
|
141158
|
141159
|
141160
|
141161
|
141162
|
141163
|
141164
|
144335
|
144336
|
144380
|
144384
|
151095
|
151096
|
151097
|
151098
|
151099
|
151102
|
151103
|
151104
|
151105
|
151106
|
151377
|
151378
|
151379
|
151380
|
151381
|
154379
|
154380
|
154381
|
154382
|
154383
|
156815
|
156816
|
156817
|
156818
|
156819
|
159142
|
159143
|
159144
|
159145
|
159146
|
159147
|
159148
|
163623
|
170014
|
170015
|
170016
|
170017
|
170018
|
170019
|
170026
|
170027
|
170028
|
170029
|
170030
|
170031
|
170983
|
170984
|
170985
|
170986
|
170987
|
170988