diff --git a/classes/core/PKPApplication.php b/classes/core/PKPApplication.php
index 7e92aad6adb..434161ca00a 100644
--- a/classes/core/PKPApplication.php
+++ b/classes/core/PKPApplication.php
@@ -38,6 +38,7 @@
use PKP\site\Version;
use PKP\site\VersionDAO;
use PKP\submission\RepresentationDAOInterface;
+use TemplateManager;
interface iPKPApplicationInfoProvider
{
@@ -435,8 +436,13 @@ public function execute(): void
}
} catch (\Symfony\Component\HttpKernel\Exception\NotFoundHttpException) {
header('HTTP/1.0 404 Not Found');
- echo "
404 Not Found
\n";
- exit;
+ $templateMgr = TemplateManager::getManager($this->getRequest());
+ $templateMgr->assign([
+ 'pageTitle' => 'api.404.resourceNotFound',
+ 'errorMsg' => '',
+ 'errorParams' => [],
+ ]);
+ $templateMgr->display('frontend/pages/error.tpl');
} catch (\Symfony\Component\HttpKernel\Exception\GoneHttpException) {
header('HTTP/1.0 410 Gone');
echo "404 Not Found
\n";
diff --git a/pages/management/ManagementHandler.php b/pages/management/ManagementHandler.php
index 3ba923d9f60..6ff38a9ac1c 100644
--- a/pages/management/ManagementHandler.php
+++ b/pages/management/ManagementHandler.php
@@ -600,7 +600,7 @@ public function editUser(array $args, $request): void
$invitationHandler = $invitation->getInvitationUIActionRedirectController();
$invitationHandler->createHandle($request,$userId);
} else {
- $request->getDispatcher()->handle404();
+ throw new \Symfony\Component\HttpKernel\Exception\NotFoundHttpException();
}
}