Hi all
I ran into a documentation discrepancy when setting up a custom CKEditor build for the RTE addon and wanted to flag it. The docs for Custom CKEditor plugins state:
> “If enabled, RTE instances running CKEditor will be built using the script in themes/user/rte/javascript/ folder.”
The actual path the code resolves to is different. When rte_custom_ckeditor_build is enabled, CkeditorService.php calls ee()->cp->load_package_js('ckeditor'). This goes through Cp::load_package_js() → add_js_script(['package' => 'rte:ckeditor']), which is served by the CP JavaScript combo loader (legacy/controllers/cp/javascript.php), which resolves package type scripts via:
Docs url: https://docs.expressionengine.com/latest/add-ons/rte.html#configuration-json
php
$file = PATH_THIRD . $package . '/javascript/' . $loadfile . '.js';
// fallback:
$file = PATH_ADDONS . $package . '/javascript/' . $loadfile . '.js';PATH_THIRD is {system}/user/addons/ — so the correct path for the custom build is:
{system}/user/addons/rte/javascript/ckeditor.js
(i.e. system/user/addons/rte/javascript/ckeditor.js in a typical EE 7 install)
Placing the file in themes/user/rte/javascript/ as the docs describe will silently fall through to the bundled build with no error, making this tricky to debug.
Also flagging a separate issue: rte/javascript/rte.js references $.browser.safari in two places (redrawContainerIfSafari and redrawSettingsIfSafari). $.browser was removed from jQuery in v1.9, causing an uncaught TypeError every time a toolbar button is clicked or dragged in the RTE toolset configurator. A simple null guard fixes it:
js
// Before:
if ($.browser.safari) ...
// After:
if ($.browser && $.browser.safari) ...Confirmed present in both EE 7.5.9 and 7.5.22. Happy to submit a PR for both if that’s helpful.
Anyone have extra details about this that might help?
thanks! Rowan
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.