ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.79k stars 2.48k forks source link

js error in git ckeditor/samples/toolbarconfigurator core/tools.js #4002

Closed themanyone closed 4 years ago

themanyone commented 4 years ago

Type of report

Bugfix patch

Provide detailed reproduction steps (if any)

  1. pbt: obtain the latest git versio nof ckeditor
  2. Using Chrome browser, navigate to ckeditor/samples/toolbarconfigurator
  3. Note errors in ckeditor/core/tools.js

Expected result

no eeeeror

Actual result

 tools.js:1236 Uncaught TypeError: Cannot read property 'event' of undefined at new eventsBuffer (tools.js:1236) at index.html:415 at index.html:444 eventsBuffer @ tools.js:1236 (anonymous) @ index.html:415 (anonymous) @ index.html:444 

Other details

Fix/patch: I removed "new" from line 415 in ckeditor/samples/toolbarconfigurator/index.html Seems to have fixed all errors and it works.

themanyone commented 4 years ago

Fix/patch: I removed "new" from line 415 in ckeditor/samples/toolbarconfigurator/index.html Seems to have fixed all errors and it works.

Dumluregn commented 4 years ago

I confirm the error is present, also when using our CDN. It's a regression introduced in 4.11.0.

jacekbogdanski commented 4 years ago

So, it looks like the API has been incorrectly used and CKEDITOR.tools.eventsBuffer in > 4.11.0 shouldn't be initialized, as it's not a class, but a method. It worked due to JS mechanism but was not intended to be initialized with new keyword. That means it's not a regression requiring some core changes, but simple samples issue.

Refactoring into this method in 4.11.0 revealed samples bug.

jacekbogdanski commented 4 years ago

Closed in https://github.com/ckeditor/ckeditor4/pull/4083