Bugzilla – Attachment 147717 Details for
Bug 32613
Add auto-completion to our SQL reports editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32613: (follow-up) Cache the tables
Bug-32613-follow-up-Cache-the-tables.patch (text/plain), 1.23 KB, created by
Nick Clemens (kidclamp)
on 2023-03-03 16:45:50 UTC
(
hide
)
Description:
Bug 32613: (follow-up) Cache the tables
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-03-03 16:45:50 UTC
Size:
1.23 KB
patch
obsolete
>From 60a16dc08cae3d4dee77e2aae5e25b2e108c5cfb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 3 Mar 2023 16:43:54 +0000 >Subject: [PATCH] Bug 32613: (follow-up) Cache the tables > >This shouldn't be expected to change, except maybe after an upgrade, >seems worth caching. > >To test: >1 - Apply patch >2 - Confirm the feature still works >--- > reports/guided_reports.pl | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index fcd3cf2298..facd2a1d01 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -1036,6 +1036,9 @@ sub header_cell_loop { > #get a list of available tables for auto-complete > sub get_tables { > my $result = {}; >+ my $cache = Koha::Caches->get_instance(); >+ my $tables = $cache->get_from_cache("Reports-SQL_tables-for-autocomplete"); >+ return $tables if $tables; > my $tables = C4::Reports::Guided->get_all_tables(); > for my $table (@{$tables}) { > my $sql = "SHOW COLUMNS FROM $table"; >@@ -1044,6 +1047,7 @@ sub get_tables { > push @{$result->{$table}}, $row->{Field}; > } > } >+ $cache->set_in_cache("Reports-SQL_tables-for-autocomplete",$result); > return $result; > } > >-- >2.30.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 32613
:
147556
|
147557
|
147610
|
147611
|
147612
|
147660
|
147661
|
147672
|
147673
|
147674
|
147715
|
147716
|
147717
|
147795