Skip to content

Commit

Permalink
pkp/pkp-lib#8333 Replaced CONTEXT_ID_NONE by SITE_CONTEXT_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasraoni committed Jul 24, 2024
1 parent 4e0c352 commit c81c679
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pages/oai/OAIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion pages/preprints/SectionsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c81c679

Please sign in to comment.