Index: branches/5.2.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r15065 -r15073 --- branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 15065) +++ branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 15073) @@ -1,6 +1,6 @@ getPrefixSpecial() . '] in checkItemStatus, leading to "404 Not Found"', E_USER_NOTICE); - header('HTTP/1.0 404 Not Found'); + $vars = $this->Application->UrlManager->prepare404(); - while (ob_get_level()) { - ob_end_clean(); + foreach ($vars as $var_name => $var_value) { + $this->Application->SetVar($var_name, $var_value); } - // object is used inside template parsing, so break out any parsing and return error document - $error_template = $this->Application->ConfigValue('ErrorTemplate'); - - $themes_helper =& $this->Application->recallObject('ThemesHelper'); - /* @var $themes_helper kThemesHelper */ - - $this->Application->SetVar('t', $error_template); - $this->Application->SetVar('m_cat_id', $themes_helper->getPageByTemplate($error_template)); - // in case if missing item is recalled first from event (not from template) - $this->Application->InitParser(); - $this->Application->HTML = $this->Application->ParseBlock(Array ('name' => $error_template)); + $this->Application->QuickRun(); $this->Application->Done(); exit; }