CKEditor
For Apache:
Add the correct MIME type for `.mjs`:
<IfModule mod_mime.c>
AddType application/javascript .mjs
</IfModule>Then restart Apache (for example, `systemctl restart apache2` or `httpd`).
For nginx:
Make sure `.mjs` is mapped to JavaScript in the `http` block:
http {
include mime.types;
types {
application/javascript js mjs;
}
# ...
}If you already have a `types` block with `application/javascript js;`, just add `mjs`:
types {
application/javascript js mjs;
}
Then reload nginx:
nginx -t
systemctl reload nginxTinyMCE
These TinyMCE errors mean that the JavaScript files for icons and plugins are not being correctly loaded from the URLs TinyMCE expects (missing files, wrong paths, or HTML error pages instead of JS).
- Check that the files really exist
Open these URLs directly in the browser:
- http://192.168.50.162/cache/1772092595/default/tinymce/icons/default/icons.min.js
- http://192.168.50.162/cache/1772092595/default/tinymce/plugins/autosave/plugin.min.js
- http://192.168.50.162/cache/1772092595/default/tinymce/plugins/emoticons/plugin.min.js
etc- Run 'Upgrade' via administration to clean the caches
- Clear the browser's caches
The direct links to the cache work perfectly. Otherwise, it wouldn't work with other browsers.
But I solved the problem !!!
Apparently, Firefox was experiencing an intermittent cache management issue for the editor. (in my case)
I proved it by disabling "simplecache" in the administration panel, and it worked (slowly).
So I re-enabled "simplecache" in the administration panel, and removed the "php_opcache.dll" extension from my PHP 8.4.18 server.
Now it works perfectly with Firefox !!!
Thanks, Nikolai, for your help.
You forgot to register the event 'register' => 'menu:title' in the elgg-plugin.php.
'events' => [
'register' => [
'menu:title' => [
'\MyPlugin\Profile\Menus\Title::register' => [],
],
],
],Now create a file \mod\my_plugin\classes\MyPlugin\Profile\Menus\Title.php with this code:
<?php
namespace MyPlugin\Profile\Menus;
class Title {
public static function register(\Elgg\Event $event) {
$user = $event->getEntityParam();
if (!$user instanceof \ElggUser || !$user->canEdit() || !elgg_in_context('profile')) {
return;
}
$return = $event->getValue();
$return[] = \ElggMenuItem::factory([
'name' => 'avatar:edit',
'icon' => 'image',
'text' => elgg_echo('avatar:edit'),
'href' => elgg_generate_entity_url($user, 'edit', 'avatar'),
'link_class' => ['elgg-button', 'elgg-button-action'],
]);
return $return;
}
}
Fantastic!
Thank you so much for the fast and easily understandable answer.
At least I had the folder path correct in the first try.
The idea for the menu was also the right one, but not fully correct.
And once again, I forgot to register the event in my plugin. That's a lesson you taught me before, but I forgot as I didn't do any updates on my Elgg since last Spring.
I applied the code already and it looks perfect now.
Once again, thank you very much for your help!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.