Opened 3 years ago

Closed 3 years ago

#13494 closed Bug (fixed)

Toolbar Configurator Error if some plugin requires one of the plugins which TConf tries to remove

Reported by: Steve James Owned by: Szymon Kupś
Priority: Normal Milestone: CKEditor 4.5.2
Component: UI : Toolbar Version: 4.5.1
Keywords: Cc:

Description

IE11 Full Build with extra plug-ins

Loaded toolbar configurator got browser exception when switching to toolbar advanced mode. (I had the IE debugger loaded.)

I have attached a screen shot and my build-config.js file for reference.

Attachments (2)

Capture.JPG (184.0 KB) - added by Steve James 3 years ago.
Screen Capture of error state in IE11 debugger
build-config.js (3.7 KB) - added by Steve James 3 years ago.
My build-config.js file

Download all attachments as: .zip

Change History (12)

Changed 3 years ago by Steve James

Attachment: Capture.JPG added

Screen Capture of error state in IE11 debugger

Changed 3 years ago by Steve James

Attachment: build-config.js added

My build-config.js file

comment:1 Changed 3 years ago by Piotrek Koszuliński

Some 3rd party plugins may not work out of the box. If it requires some configuration options or works under certain conditions, then these conditions may not be met in the toolbar configurator. Then, problems may occur and there's no solution for that as we don't control those plugins.

Question is - how to notify the user about such problems.

Second thing - if the Start sample works, then toolbar configurator should too unless I miss something.

comment:2 Changed 3 years ago by Piotrek Koszuliński

Keywords: Toolbar Configurator removed
Milestone: CKEditor 4.5.2
Status: newconfirmed
Summary: Toolbar Configurator ErrorToolbar Configurator Error if some plugin requires one of the plugins which TConf tries to remove

I've just realised that tconf tries to remove some plugins to speed it up. This breaks wordcount. So this is a valid issue.

comment:3 Changed 3 years ago by Jakub Ś

@SteveTheTechie the problem is WourCount plugin.

First problem is that it requires htmlwriter plugin which configurator tries to remove. This is confirmed bug.

The problem is that this plugin, even after fixing above problem (or simply removing requirement from plugin's code), will not work anyway and break configurator.
This should be reported to plugin author.
There is a method inside plugin counterElement(editorInstance) which evaluets to null and causes exception in code counterElement(editorInstance).innerHTML. Generally plugin is missing some checks whether footer is even available and fail gently (with some console log) if it is not.

comment:4 Changed 3 years ago by Steve James

Good work on the troubleshooting!

I do think this does sort of point to the challenges of trying to make the configurator code reliably decipher all of the installed plug-ins and make the Toolbar Configurator work accordingly.

comment:5 Changed 3 years ago by Szymon Kupś

Owner: set to Szymon Kupś
Status: confirmedassigned

comment:6 Changed 3 years ago by Szymon Kupś

It looks like required plugins are loaded properly and error is intentionally placed in timeout to prevent any blocking. It informs that there was a plugin on config.removePlugins list but it was loaded anyway because it is required by some other plugin (in this case htmlwriter plugin is required by wordcount plugin).

Possible solutions:

  • Keep whole plugins list without removing anything by toolbar configurator.
  • Check if plugins are required by other plugins before removing them by toolbar configurator. Plugin removal is happening on configLoaded event, before loading actual plugins. Checking dependencies in not yet loaded plugins might be tricky.
  • Change the way user is informed about plugins that cannot be removed. Now error is thrown and may suggest that something went wrong.
Last edited 3 years ago by Szymon Kupś (previous) (diff)

comment:7 Changed 3 years ago by Piotrek Koszuliński

Keep whole plugins list without removing anything by toolbar configurator.

Yep. This will be the simplest solution. The list of plugins was trimmed to try to speed up editor initialisation, but we haven't thought about requirements. Let's just deoptimise this. Not a big deal.

comment:8 Changed 3 years ago by Szymon Kupś

Status: assignedreview

Deleted code that was responsible for plugin removal by toolbar configurator.
Pushed branch:t/13494.

Note: there are still errors caused by wordcount plugin (comment:3) that should be reported to the plugin author.

comment:9 Changed 3 years ago by Olek Nowodziński

Status: reviewreview_passed

comment:10 Changed 3 years ago by Olek Nowodziński

Resolution: fixed
Status: review_passedclosed

Merged git:894c103 into master.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy