Index: branches/5.2.x/core/units/helpers/themes_helper.php =================================================================== diff -u -N -r15278 -r15390 --- branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 15278) +++ branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 15390) @@ -1,6 +1,6 @@ getCurrentThemeId(); } + $template_crc = kUtil::crc32(mb_strtolower($template)); + $sql = 'SELECT ' . $this->Application->getUnitOption('c', 'IDField') . ' FROM ' . $this->Application->getUnitOption('c', 'TableName') . ' WHERE ( - (NamedParentPath = ' . $this->Conn->qstr('Content/' . $template) . ') OR - (`Type` = ' . PAGE_TYPE_TEMPLATE . ' AND CachedTemplate = ' . $this->Conn->qstr($template) . ') + (NamedParentPathHash = ' . $template_crc . ') OR + (`Type` = ' . PAGE_TYPE_TEMPLATE . ' AND CachedTemplateHash = ' . $template_crc . ') ) AND (ThemeId = ' . $theme_id . ($theme_id > 0 ? ' OR ThemeId = 0' : '') . ')';