Bugzilla – Attachment 52397 Details for
Bug 16734
getLanguages() in opac-search.pl should be called only if needed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16734: getLanguages() in opac-search.pl should be called only if needed
Bug-16734-getLanguages-in-opac-searchpl-should-be-.patch (text/plain), 2.45 KB, created by
Jonathan Druart
on 2016-06-14 16:03:58 UTC
(
hide
)
Description:
Bug 16734: getLanguages() in opac-search.pl should be called only if needed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-06-14 16:03:58 UTC
Size:
2.45 KB
patch
obsolete
>From 65a28f7ffa29b32e9ac7a13ec5001c1b26706430 Mon Sep 17 00:00:00 2001 >From: Jacek Ablewicz <abl@biblos.pk.edu.pl> >Date: Tue, 14 Jun 2016 16:31:57 +0200 >Subject: [PATCH] Bug 16734: getLanguages() in opac-search.pl should be called > only if needed >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >There is no need to always call getLanguages() in opac/opac-search.pl >(especially not if it's an actual search), it's output is used only >in opac-advsearch.tt template. This patch moves it into >'if ( ... $template_type eq 'advsearch' )' block. > >Speed gain is rather moderate (40 - 80 msec, if the mysql server >is no too busy, and the results are already in query cache), >but it eliminates a lot of small DBI calls, making a further >profiling of OPAC searches a bit easier. > >Test plan: just ensure that language selection is still available >on OPAC advanced search page, and that it still works like intended. > >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > opac/opac-search.pl | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 64b8800..d947b06 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -217,10 +217,6 @@ my $branches = GetBranches(); # used later in *getRecords, probably should be > my $library_categories = Koha::LibraryCategories->search( { categorytype => 'searchdomain' }, { order_by => [ 'categorytype', 'categorycode' ] } ); > $template->param( searchdomainloop => $library_categories ); > >-# load the language limits (for search) >-my $languages_limit_loop = getLanguages($lang, 1); >-$template->param(search_languages_loop => $languages_limit_loop,); >- > # load the Type stuff > my $itemtypes = GetItemTypesCategorized; > # add translated_description to itemtypes >@@ -303,6 +299,10 @@ $template->param(advancedsearchesloop => \@advancedsearchesloop); > > # The following should only be loaded if we're bringing up the advanced search template > if ( $template_type && $template_type eq 'advsearch' ) { >+ # load the language limits (for search) >+ my $languages_limit_loop = getLanguages($lang, 1); >+ $template->param(search_languages_loop => $languages_limit_loop); >+ > # load the servers (used for searching -- to do federated searching, etc.) > my $primary_servers_loop;# = displayPrimaryServers(); > $template->param(outer_servers_loop => $primary_servers_loop,); >-- >2.8.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 16734
:
52374
|
52390
| 52397