From ab0760d9ec7d71c3ee373eb80fa2f9feaa10be18 Mon Sep 17 00:00:00 2001 From: Arkadiusz Filipczak Date: Mon, 19 Feb 2024 14:05:17 +0100 Subject: [PATCH] Rename ImageInsertViaUrlUI.init() to afterInit(). --- .../src/imageinsert/imageinsertviaurlui.ts | 2 +- .../tests/imageinsert/imageinsertviaurlui.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/ckeditor5-image/src/imageinsert/imageinsertviaurlui.ts b/packages/ckeditor5-image/src/imageinsert/imageinsertviaurlui.ts index 56ad00d34b5..4c6e6ecbd91 100644 --- a/packages/ckeditor5-image/src/imageinsert/imageinsertviaurlui.ts +++ b/packages/ckeditor5-image/src/imageinsert/imageinsertviaurlui.ts @@ -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' )!; diff --git a/packages/ckeditor5-image/tests/imageinsert/imageinsertviaurlui.js b/packages/ckeditor5-image/tests/imageinsert/imageinsertviaurlui.js index dddc82fda4a..ff0f290fc12 100644 --- a/packages/ckeditor5-image/tests/imageinsert/imageinsertviaurlui.js +++ b/packages/ckeditor5-image/tests/imageinsert/imageinsertviaurlui.js @@ -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( {