Bug: Ckeditor Plugin: this.editor.neos.contextPath
is not available during plugin init()
#3223
Labels
this.editor.neos.contextPath
is not available during plugin init()
#3223
Description
this line should make it easy to find out inside a Ckeditor plugin the current
contextPath
andpropertyName
(among others things)neos-ui/packages/neos-ui-ckeditor5-bindings/src/ckEditorApi.js
Lines 75 to 76 in 7665b05
But
editor.neos
is initialized only after the editor has been created (see the asyncthen
)This results in not beeing able to access
neos
at first but we need to wait for the next iteration in the eventloopas shown in this plugin
Prgfx.Neos.DynamicPlaceholder
by @PRGfxhttps://github.com/PRGfx/Prgfx.Neos.DynamicPlaceholder/blob/c301d04a399ca1b85cdbca1418f3370a9e8540f3/Resources/Private/src/manifest.js#L40-L49
i can also confirm this behaviour, in my case i used
setTimeOut(() => console.log(this.editor.neos), 0)
Fyi - this is purely an extension point and not used in the codebase.
Proposal to fix this:
i dislike the "hack" that we attach something to
this.editor
-> as that could break any minute -> if ck decides to make editor immutable.i also dislike god objects -> and the editor just has become one. (even the global registry is available via editor.neos)
a fine solution would be to use the editor identifier / instance and have some registry to resolve this identity back to
contextPath
andpropertyName
The text was updated successfully, but these errors were encountered: