Merge pull request #2881 from sminnee/fix-forum-templates

FIX: Fixed regression in ContentController template selection.
This commit is contained in:
Ingo Schommer 2014-02-20 23:02:40 +13:00
commit d6da92edeb

View File

@ -721,6 +721,13 @@ class SSViewer {
foreach($classes as $class) {
$template = $class . $suffix;
if(SSViewer::hasTemplate($template)) $templates[] = $template;
// If the class is "Page_Controller", look for Page.ss
if(stripos($class,'_controller') !== false) {
$template = str_ireplace('_controller','',$class) . $suffix;
if(SSViewer::hasTemplate($template)) $templates[] = $template;
}
if($baseClass && $class == $baseClass) break;
}
return $templates;