Bug 27293

Summary: Refactor C4::Templates and C4::Languages to not use CGI objects directly
Product: Koha Reporter: David Cook <dcook>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description David Cook 2020-12-22 07:12:49 UTC
If you look through C4::Templates and C4::Languages, you'll see CGI objects being passed around a lot.

In the end, all that C4::Templates::gettemplate() and C4::Languages::getlanguage need are the "language" param and the "KohaOpacLanguage" cookie. We should be fetching these appropriately from the CGI or PSGI or whatever context at a higher level and passing back the data rather than the objects.
Comment 1 David Cook 2020-12-22 07:28:01 UTC
We could also remove the following warnings since they're not actually useful:

[2020/12/22 07:00:36] [WARN] no query in gettemplate at /kohadevbox/koha/C4/Templates.pm line 206.
[2020/12/22 07:00:36] [WARN] no query in themelanguage at /kohadevbox/koha/C4/Templates.pm line 266.