Closed contaoacademy closed 2 years ago
Can confirm. The developer console throws an error.
Maybe the same issue as #262
@contaoacademy possibly, but the behavior is slightly different. TinyMCE does not load for me at all when I use Contao 4.13.
Now that my tinyMCE is showing again I was able to look into the autosuggester problem. I'm not familiar with tinyMCE at all but the problem seems to be in assets/autosuggester.js:164
:
// Add the events to tinyMCE
if (this.tinyMCE) {
if (window.tinyMCE.majorVersion == '4') {
this.tinyMCE.on('keyUp', function(event) {
this.eventKeyUp.call(this, event);
}.bind(this));
window.tinyMCE
is not defined, this.tinyMCE
is. However, this.tinyMCE
does not have a property called majorVersion
or version
at all at least in my installation. This means that the check for version 4 fails and the nonexistent property onKeyUp
causes the error in our developer consoles.
Knowing virtually nothing about tinyMCE I don't know if this is the proper solution. However at least in my installation, instead of looking for the version number checking for the existence of the on
function leads to the autosuggester working again:
// Add the events to tinyMCE
if (this.tinyMCE) {
if (typeof this.tinyMCE.on === 'function') {
this.tinyMCE.on('keyUp', function(event) {
this.eventKeyUp.call(this, event);
}.bind(this));
Let me know if this is the right approach I could try creating a pull request .. would have to figure out how to minify the Javascript properly though :clown_face: . If switching out the line and minifying the JS is something that comes easy in your development workflow I will be happy if anyone else wants to do it.
@contaoacademy , @cliffparnitzky feel free to try out https://github.com/philvdb/contao-notification_center to see whether it solves the problem for you as well and report back here.
@philvdb Looks great! Works for me. Thank you.
If I type
##
in the RAW text-window, then autocomplete comes up automatically for me. If I enable text and HTML and try to do the same in TinyMCE, then autocomplete does not show up.Currently, I could only reproduce the problem under Contao 4.13 because under Contao 4.9 it still works as expected.