improve ::Common::PSGI->templateDir
Concerned version
Version: 2.0.14
Summary
The templateDir
attribute of PSGI objects is inconsistent and has bugs:
- Declared as
Str|ArrayRef
in ::Common::PSGI - But concatenated as it it was always a flat string here
- Portal's templateDir grows at every request here
- Portal's templateDir is not even used in Portal::Main::sendHtml to locate the template, path is constructed from
$self->conf->{templateDir}
It would be nice if templateDir could be set (in .ini or at PSGI object creation) to an arrayref. This would allow us to write unit tests that use custom skins (in t/templates + site/templates, which is not possible currently)
TODO:
- build sendHTML/loadTemplate paths from product of templateDirs x [ current_skin, bootstrap ]
- handle trOver
- replace all calls to $self->conf->{templateDir} with a path lookup method
- fix attachment in emails
After #2789 (closed) is fixed, investigate HTML_TEMPLATE_ROOT