Ckeditor4: Removing toolbar plugin not possible (required by notification plugin)

Created on 9 Jun 2017  路  9Comments  路  Source: ckeditor/ckeditor4

Are you reporting a feature or a bug?

Bug

Provide detailed reproduction steps (if any)

  1. Create CKEditor config that removes the toolbar and the statusbar (elementspath)
    {removePlugins: 'elementspath, toolbar'}

We would like to provide our own toolbar ui.

Expected result

The toolbar will be removed from the CKEditor instance

Actual result

Error code: editor-plugin-required.
Object plugin: "toolbar" requiredBy: "notification"

The notification plugin has a dependency to the toolbar plugin. Removing also the notification plugin is not an option because a lot of other plugins have dependency to the notification plugin.

What is the actual result of the above steps?
CKEditor will be shown with his own toolbar.

Other details

  • Browser: Chrome
  • OS: Windows
  • CKEditor version: 4.7.0
  • Installed CKEditor plugins: standard-full
notification confirmed bug

All 9 comments

Hmm, that's actually a good point I also feel like notification shouldn't require toolbar button, however a quick look shows that it depends on it for positioning.

I'll leave it for confirmation, so that some1 will step in and do a bit deeper investigation.

@wwalc @Reinmar @fredck ?

+1

Looking at http://docs.ckeditor.com/source/plugin39.html .. it's not even clear WHY the notification plugin has any programmatic need to require the toolbar plugin. Surely in its positioning calculations it could just detect whether a toolbar exists or not, and calculate accordingly. The supposed 'require'ment seems like nonsense..

@mlewand Surely this is therefore quite easily resolvable?

From _layout function description:

Sets the position of the notification area based on the editor content, toolbar as well as viewport position and dimensions.

So it seems the only place where toolbar is used/accessed is the _layout function which uses it to calculate proper notification area position. It should be checked how absence of a toolbar affects those cases. Probably if there is no toolbar it should not be considered in a calculations as @jonnott pointed out.

@f1ames I'm struggling to see where there is actually any use of toolbar code at all here.. maybe in function setBelowToolbar() { .. ), but that doesn't even seem to contain anything that's toolbar plugin-specific.

I'm at a loss to why this plugin even requires the toolbar plugin at all - can anyone point to the lines of code in question, or suggest what exactly would go wrong in this plugin's code if the toolbar plugin wasn't there??

@mlewand

So is this now fixed in the current release (4.7.2/3) ?

@jonnott, yes this particular issue had been fixed with release 4.7.2 (see Milestone), however to fully handle this issue, additional two fixes are required: #654, #678 which are targeted to 4.8.0 (you can see planned release date in the milestone details page).

Was this page helpful?
0 / 5 - 0 ratings