Bug #77698
closedCustom Plugin for RTE causes Error on Editor initialization
0%
Description
I've tried to add a custom button to rtehtmlarea.
On initialization the RTE hangs with a 404 error for the required JavaScript File and RequireJS throws an error.
The Reason: The registerPlugin Method in Editor.js uses the following namespace for requirejs -> TYPO3/CMS/Rtehtmlarea/Plugins/<MyPluginname> instead of TYPO3/CMS/<MyPackagename>/Plugins/<MyPluginname>
I would fix it, but I need to know what is the best way for getting the full Pluginnamespace or Packagename in this scope?
Updated by Marco Dinnbier almost 8 years ago
My current Workaround in the main method of RTE plugin:
$pageRenderer = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); $pluginName = $this->pluginName; $packagename = GeneralUtility::underscoredToUpperCamelCase($this->extensionKey); $jsCode = "define('TYPO3/CMS/Rtehtmlarea/Plugins/$pluginName',['TYPO3/CMS/$packagename/Plugins/$pluginName'],function (Plugin) {return Plugin;});"; $pageRenderer->addJsInlineCode($this->extensionKey . $pluginName . "_workaround see https://forge.typo3.org/issues/77698",$jsCode);
Updated by Kevin Ditscheid almost 8 years ago
Marco Dinnbier wrote:
My current Workaround in the main method of RTE plugin:
[...]
As the RichTextElement loads your requireJS module anyway, the workaround could be done without changing the RTE plugin by simply adding the line
define('TYPO3/CMS/Rtehtmlarea/Plugins/YourPluginName',['TYPO3/CMS/YourPackageName/Plugins/YourPluginName'],function (Plugin) {return Plugin;});
at the beginning of your requireJS module JavaScript File.
This still stays a workaround, though.
Updated by Riccardo De Contardi over 7 years ago
- Status changed from New to Closed
we are sorry, but we close this issue as now TYPO3 uses CKEditor and RTEHtmlarea development has been stopped.
RTEHtmlarea has been decoupled from the core and its code is available on GitHub:
https://github.com/FriendsOfTYPO3/rtehtmlarea
If you still need this fixed please create a PR on GitHub