Skip to content

Commit 774e5ff

Browse files
#9453 Fix getting context for admin interfaces
1 parent 190f0d0 commit 774e5ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

classes/template/PKPTemplateManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ public function display($template = null, $cache_id = null, $compile_id = null,
12161216
$context = $request->getContext();
12171217

12181218
$pageContext = [
1219-
'apiBaseUrl' => $dispatcher->url($request, PKPApplication::ROUTE_API, $context->getPath())
1219+
'apiBaseUrl' => $dispatcher->url($request, PKPApplication::ROUTE_API, $context?->getPath() ?: 'index')
12201220
];
12211221
$output .= 'pkp.context = ' . json_encode($pageContext) . ';';
12221222

0 commit comments

Comments
 (0)