From 774e5ffa59df11cf8ed14d6735ca90dcd67b570b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jarda=20Kot=C4=9B=C5=A1ovec?= Date: Wed, 17 Jan 2024 14:23:00 +0100 Subject: [PATCH] pkp/pkp-lib#9453 Fix getting context for admin interfaces --- classes/template/PKPTemplateManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/template/PKPTemplateManager.php b/classes/template/PKPTemplateManager.php index 65e96ef3331..3e9fb5189e7 100644 --- a/classes/template/PKPTemplateManager.php +++ b/classes/template/PKPTemplateManager.php @@ -1216,7 +1216,7 @@ public function display($template = null, $cache_id = null, $compile_id = null, $context = $request->getContext(); $pageContext = [ - 'apiBaseUrl' => $dispatcher->url($request, PKPApplication::ROUTE_API, $context->getPath()) + 'apiBaseUrl' => $dispatcher->url($request, PKPApplication::ROUTE_API, $context?->getPath() ?: 'index') ]; $output .= 'pkp.context = ' . json_encode($pageContext) . ';';