https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24975 --- Comment #125 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #114)
Created attachment 150015 [details] [review] Bug 24975: Simplify and uniform calls to get the translation
This patch add a caching mecanism for ItemType objects. We are also caching the result of the image location and the translation key so that we can retrieve from the cache and pass them to the temmplate.
We should avoid call to db_t in the controller scripts, and prefer to pass the itemtype object and let the template does what it needs (retrieve the translated description, display the image)
Note that the new Koha::Template::Plugin::ItemTypes->GetSorted should certainly be used in other places, for instance in * catalogue/search.pl sub prepare_adv_search_types * opac/opac-search.pl but those 2 occurrences are tricky and we would like to prevent regressions (as much as possible...)
A major change is the modification of the prototype of search_compat, I am not sure this patch is updating all the template when the result of the search is passed.
Note that Koha::SearchEngine::Elasticsearch::Search could use Koha::ItemTypes->get_from_cache, and certainly other places as well(?)
This patch was quite good. Will move it to a separate bug. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.