Move default themes lookup before cache check

This commit is contained in:
Robbie Averill 2018-10-05 15:00:32 +02:00
parent da9301f241
commit 024762f03b

View File

@ -191,16 +191,16 @@ class ThemeResourceLoader implements Flushable
*/
public function findTemplate($template, $themes = null)
{
if ($themes === null) {
$themes = SSViewer::get_themes();
}
// Look for a cached result for this data set
$cacheKey = md5(json_encode($template) . json_encode($themes));
if ($this->getCache()->has($cacheKey)) {
return $this->getCache()->get($cacheKey);
}
if ($themes === null) {
$themes = SSViewer::get_themes();
}
$type = '';
if (is_array($template)) {
// Check if templates has type specified