Index: branches/5.2.x/core/kernel/managers/url_manager.php =================================================================== diff -u -N -r15543 -r15727 --- branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 15543) +++ branches/5.2.x/core/kernel/managers/url_manager.php (.../url_manager.php) (revision 15727) @@ -1,6 +1,6 @@ prepare404(); + + foreach ($vars as $var_name => $var_value) { + $this->Application->SetVar($var_name, $var_value); + } + + // ensure parser is available (e.g. 404 page requested from event) + $this->Application->QuickRun(); + $this->Application->Done(); + exit; + } } \ No newline at end of file Index: branches/5.2.x/core/kernel/db/dblist.php =================================================================== diff -u -N -r15464 -r15727 --- branches/5.2.x/core/kernel/db/dblist.php (.../dblist.php) (revision 15464) +++ branches/5.2.x/core/kernel/db/dblist.php (.../dblist.php) (revision 15727) @@ -1,6 +1,6 @@ Records = $this->Conn->Query($sql); if (!$this->Records && ($this->Page > 1)) { - // no records & page > 1, try to reset to 1st page (works only when list in not counted before) - $this->Application->StoreVar($this->getPrefixSpecial() . '_Page', 1, true); - $this->SetPage(1); - $this->Query($force); + // no records & page > 1, show 404 page + trigger_error('Unknown page ' . $this->Page . ' in ' . $this->getPrefixSpecial() . ' list, leading to "404 Not Found"', E_USER_NOTICE); + + $this->Application->UrlManager->show404(); } $this->SelectedCount = count($this->Records); Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -N -r15710 -r15727 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15710) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15727) @@ -1,6 +1,6 @@ InitParser(); - $this->HTML = $this->ParseBlock(Array ('name' => $this->GetVar('t'))); + $this->HTML = $this->Parser->Run($this->GetVar('t')); } /** Index: branches/5.2.x/core/kernel/db/db_event_handler.php =================================================================== diff -u -N -r15608 -r15727 --- branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 15608) +++ branches/5.2.x/core/kernel/db/db_event_handler.php (.../db_event_handler.php) (revision 15727) @@ -1,6 +1,6 @@ getPrefixSpecial() . '] in checkItemStatus, leading to "404 Not Found"', E_USER_NOTICE); - $vars = $this->Application->UrlManager->prepare404(); - - foreach ($vars as $var_name => $var_value) { - $this->Application->SetVar($var_name, $var_value); - } - - // in case if missing item is recalled first from event (not from template) - $this->Application->QuickRun(); - $this->Application->Done(); - exit; + $this->Application->UrlManager->show404(); } /**