Index: branches/5.2.x/core/units/helpers/themes_helper.php =================================================================== diff -u -N -r16588 -r16707 --- branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 16588) +++ branches/5.2.x/core/units/helpers/themes_helper.php (.../themes_helper.php) (revision 16707) @@ -1,6 +1,6 @@ Application->RecallVar('theme_id'); - if ($theme_id === false) { - // query, because "m_theme" is always empty in admin - $id_field = $this->Application->getUnitOption('theme', 'IDField'); - $table_name = $this->Application->getUnitOption('theme', 'TableName'); - - $sql = 'SELECT ' . $id_field . ' - FROM ' . $table_name . ' - WHERE (PrimaryTheme = 1) AND (Enabled = 1)'; - $theme_id = $this->Conn->GetOne($sql); + if ( $theme_id === false ) { + // Query, because "m_theme" is always empty in admin. + $theme_id = $this->Application->GetDefaultThemeId(true); } return $theme_id;