Closed (fixed)
Project:
CKEditor 4 - WYSIWYG HTML editor
Version:
6.x-1.11
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2012 at 00:24 UTC
Updated:
15 Jun 2022 at 05:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mkesicki commentedThank you for your patch. We will check this as soon as possible.
Please be patient.
Comment #2
dczepierga commented@greenSkin, could u write how to reproduce this?
Greetings
Comment #3
greenskin commentedThe steps to reproduce can be a little tricky as it is AJAX related. Basically you load the page either with the textarea loaded on page load or via an AJAX callback; no problems, everything works fine. The issue comes when you remove that textarea and replace it with the same one. The CKEditor doesn't know it was replaced so when the behaviors tries to initialize the new editor it errors that it already exists.
The simplest of fix is what the patch attempts, to destroy any pre-existing editor before trying to initialize it again.
Hope that helps. :)
Comment #4
dczepierga commented@greenSkin, could u try review my patch? It will be better to destroy CKEditor by textarea_id - if it will be more CKEditor instances in one page u will destroy last one replaced - not selected in that moment...
Greetings
Comment #5
greenskin commented@dczepierga: Yes, that works wonderfully. Thank you!
Comment #6
dczepierga commentedChanges commited to GIT (diff)
Thx for help and review patch.
Greetings
Comment #8
mkesicki commentedComment #9
alsammanKhaled commentedI am not sure if this is related or not but i am using drupal 9 and i am having a smiliar issue. when i add my ckeditor using js and remove the old one it would give this error "ckeditor.js?v=4.17.1:350 Uncaught TypeError: Cannot read properties of null (reading 'unselectable')"
when inspecting the element the ckeditor is not rendered. however without js it would render everything. I end up with a textfield element that is empty whe i use my js. is this related to here or should i make an issue or search somethinge different? any guidance is appreciated.