Index: branches/5.2.x/core/units/themes/themes_eh.php =================================================================== diff -u -N -r15145 -r16081 --- branches/5.2.x/core/units/themes/themes_eh.php (.../themes_eh.php) (revision 15145) +++ branches/5.2.x/core/units/themes/themes_eh.php (.../themes_eh.php) (revision 16081) @@ -1,6 +1,6 @@ Special == 'current' ) { + $event->setEventParam('live_table', true); + } + + parent::dbBuild($object, $event); + } + + /** + * Ensures that current theme detection will fallback to primary without extra DB query. + * + * @param kEvent $event Event. + * + * @return integer + */ + public function getPassedID(kEvent $event) + { + if ( $event->Special == 'current' ) { + $theme_id = $this->Application->GetVar('m_theme'); + + if ( !$theme_id ) { + $theme_id = 'default'; + } + + $this->Application->SetVar('m_theme', $theme_id); + $this->Application->SetVar($event->getPrefixSpecial() . '_id', $theme_id); + } + + return parent::getPassedID($event); + } + + /** * Allows to set selected theme as primary * * @param kEvent $event