From c81c679830487a44c666d1b80689e60ecc26bbfb Mon Sep 17 00:00:00 2001 From: Jonas Raoni Soares da Silva Date: Wed, 24 Jul 2024 01:29:17 +0300 Subject: [PATCH] pkp/pkp-lib#8333 Replaced CONTEXT_ID_NONE by SITE_CONTEXT_ID --- pages/oai/OAIHandler.php | 3 ++- pages/preprints/SectionsHandler.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/oai/OAIHandler.php b/pages/oai/OAIHandler.php index 2b18e3aec8..aae53b90ae 100644 --- a/pages/oai/OAIHandler.php +++ b/pages/oai/OAIHandler.php @@ -16,6 +16,7 @@ namespace APP\pages\oai; +use APP\core\Application; use APP\handler\Handler; use APP\oai\ops\ServerOAI; use Firebase\JWT\Key; @@ -42,7 +43,7 @@ public function index($args, $request) PluginRegistry::loadCategory('oaiMetadataFormats', true); $oai = new ServerOAI(new OAIConfig($request->url(null, 'oai'), Config::getVar('oai', 'repository_id'))); - if (!$request->getServer() && $request->getRouter()->getRequestedContextPath($request) != 'index') { + if (!$request->getServer() && $request->getRouter()->getRequestedContextPath($request) != Application::SITE_CONTEXT_PATH) { $dispatcher = $request->getDispatcher(); return $dispatcher->handle404(); } diff --git a/pages/preprints/SectionsHandler.php b/pages/preprints/SectionsHandler.php index 8dc7b79651..730ce52697 100644 --- a/pages/preprints/SectionsHandler.php +++ b/pages/preprints/SectionsHandler.php @@ -60,7 +60,7 @@ public function section($args, $request) $sectionPath = $args[0] ?? null; $page = isset($args[1]) && ctype_digit((string) $args[1]) ? (int) $args[1] : 1; $context = $request->getContext(); - $contextId = $context ? $context->getId() : Application::CONTEXT_ID_NONE; + $contextId = $context?->getId() ?? Application::SITE_CONTEXT_ID; // The page $arg can only contain an integer that's not 1. The first page // URL does not include page $arg