Index: branches/5.1.x/core/units/helpers/themes_helper.php =================================================================== diff -u -N -r13545 -r13951 --- branches/5.1.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 13545) +++ branches/5.1.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 13951) @@ -1,6 +1,6 @@ Conn->qstr('Content/' . $template) . ') OR - (IsSystem = 1 AND CachedTemplate = ' . $this->Conn->qstr($template) . ') + (`Type` = ' . PAGE_TYPE_TEMPLATE . ' AND CachedTemplate = ' . $this->Conn->qstr($template) . ') ) AND (ThemeId = ' . $theme_id . ($theme_id > 0 ? ' OR ThemeId = 0' : '') . ')';