Summary: | getLanguages() in opac-search.pl should be called only if needed | ||
---|---|---|---|
Product: | Koha | Reporter: | Jacek Ablewicz <abl> |
Component: | Searching | Assignee: | Jacek Ablewicz <abl> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | jonathan.druart, kyle, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12017 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 15262 | ||
Attachments: |
Bug 16734: getLanguages() in opac-search.pl should be called only if needed
Bug 16734: getLanguages() in opac-search.pl should be called only if needed Bug 16734: getLanguages() in opac-search.pl should be called only if needed |
Description
Jacek Ablewicz
2016-06-14 14:31:49 UTC
Created attachment 52374 [details] [review] Bug 16734: getLanguages() in opac-search.pl should be called only if needed 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. Created attachment 52390 [details] [review] Bug 16734: getLanguages() in opac-search.pl should be called only if needed 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> Created attachment 52397 [details] [review] Bug 16734: getLanguages() in opac-search.pl should be called only if needed 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> Pushed to master for Koha 16.11, thanks Jacek! |