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 7416fa7 commit 499c037
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 @@ -103,9 +103,8 @@ public function registerJS($hookName, $args)
];
}
$context = $request->getContext();
if ($context) {
$data['uploadUrl'] = $request->getDispatcher()->url($request, Application::ROUTE_API, $context->getPath(), '_uploadPublicFile');
}
$contextPath = $context ? $context->getPath() : Application::CONTEXT_SITE;
$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 499c037

Please sign in to comment.