Skip to content

Commit 3bcf0d8

Browse files
authored
Fix issues inserting Widgets with nested WYSIWYGs
This PR is a potential fix for issues #19742 and #13409 (Thanks to @EduardTd for pointing me in the right direction). I've tested this briefly in my own install and it appears to resolve the issue. Submitting this PR so that the issue can be tested fully.
1 parent d7ac52b commit 3bcf0d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/web/mage/adminhtml/wysiwyg/widget.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ define([
456456
parameters: params,
457457
onComplete: function (transport) {
458458
try {
459-
editor = wysiwyg.activeEditor();
459+
editor = tinyMCE.get(this.widgetTargetId);
460460

461461
widgetTools.onAjaxSuccess(transport);
462462
widgetTools.dialogWindow.modal('closeModal');
@@ -469,7 +469,7 @@ define([
469469
editor.selection.select(activeNode);
470470
editor.selection.setContent(transport.responseText);
471471
} else if (this.bMark) {
472-
wysiwyg.activeEditor().selection.moveToBookmark(this.bMark);
472+
editor.selection.moveToBookmark(this.bMark);
473473
}
474474
}
475475

@@ -513,7 +513,7 @@ define([
513513
* @return {null|wysiwyg.Editor|*}
514514
*/
515515
getWysiwyg: function () {
516-
return wysiwyg.activeEditor();
516+
return tinyMCE.get(this.widgetTargetId);
517517
},
518518

519519
/**

0 commit comments

Comments
 (0)