Skip to content

Commit

Permalink
Merge pull request #15881 from ckeditor/ck/15869
Browse files Browse the repository at this point in the history
Fix (image): Fixes the initialization of `ImageInsertViaUrlUI` so it does not depend on configured plugins order. Closes #15869.
  • Loading branch information
pomek committed Feb 19, 2024
2 parents 2b67ace + ab0760d commit a201aed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -43,7 +43,7 @@ export default class ImageInsertViaUrlUI extends Plugin {
/**
* @inheritDoc
*/
public init(): void {
public afterInit(): void {
this._imageInsertUI = this.editor.plugins.get( 'ImageInsertUI' );
const insertImageCommand: InsertImageCommand = this.editor.commands.get( 'insertImage' )!;

Expand Down
Expand Up @@ -39,6 +39,15 @@ describe( 'ImageInsertViaUrlUI', () => {
expect( ImageInsertViaUrlUI.pluginName ).to.equal( 'ImageInsertViaUrlUI' );
} );

// https://github.com/ckeditor/ckeditor5/issues/15869
it( 'should work if ImageInsertViaUrl plugin is specified before Image', async () => {
await createEditor( {
plugins: [ ImageInsertViaUrl, Image ]
} );

editor.ui.componentFactory.create( 'insertImage' );
} );

describe( 'single integration', () => {
beforeEach( async () => {
await createEditor( {
Expand Down

0 comments on commit a201aed

Please sign in to comment.