Issue with Multiple embed failing because the editorId is null

Created on 10 November 2021, over 2 years ago
Updated 17 August 2023, 11 months ago

Problem/Motivation

The postMessage event listener nulls the editorId which means if a user tries embedding another image from the same editor, nothing happens has the check below does not pass:

if (embedCode && editorId) {
const currentEditor = CKEDITOR.instances[editorId];
if (currentEditor) {
currentEditor.insertHtml(embedCode);
}
editorId = null;
}

Steps to reproduce

Use the Widen dialog plugin. Add an image from the widen search dialog. And try adding another one. Nothing happens.

Proposed resolution

Setting the editorId value in the event handler as such:

// Setting the editor ids to the current editor instance name.
editorId = CKEDITOR.currentInstance.name;
if (embedCode && editorId) {
const currentEditor = CKEDITOR.instances[editorId];
if (currentEditor) {
currentEditor.insertHtml(embedCode);
}
editorId = null;
}

πŸ› Bug report
Status

Closed: won't fix

Version

1.4

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa rawdreeg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024