Bug 27293 - Refactor C4::Templates and C4::Languages to not use CGI objects directly
Summary: Refactor C4::Templates and C4::Languages to not use CGI objects directly
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-22 07:12 UTC by David Cook
Modified: 2022-08-18 01:08 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.