Skip to content

Commit

Permalink
pkp/pkp-lib#10578 Fix: Can't upload images to TinyMCE at site level
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr committed Nov 14, 2024
1 parent bcd3e5d commit 4f09eb3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions TinyMCEPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ public function registerJS(string $hookName, array $args): bool
];
}
$context = $request->getContext();
if ($context) {
$data['uploadUrl'] = $request->getDispatcher()->url($request, Application::ROUTE_API, $context->getPath(), '_uploadPublicFile');
}
$contextPath = $context ? $context->getPath() : Application::SITE_CONTEXT_PATH;
$data['uploadUrl'] = $request->getDispatcher()->url($request, Application::ROUTE_API, $contextPath, '_uploadPublicFile');
$templateManager->addJavaScript(
'tinymceData',
'$.pkp.plugins.generic = $.pkp.plugins.generic || {};' .
Expand Down

0 comments on commit 4f09eb3

Please sign in to comment.