-
Bug
-
Resolution: Fixed
-
Normal
-
4.4.6.3
-
Security Level: Jimmy
-
None
steps to reproduce
http://zkfiddle.org/sample/32ovgu2/1-ckeditor-memory-leak
Click the add editor button
After the editor flicker in and out: press the popup button
actual result
NPE thrown in JS, current operation stopped, popup don't open
expected result
unbound editor is ignored, current operation continues, popup opens
debug info
CKeditor listener zWatch onVParent checks for ancestor from the target of VParent.
In a complex case with tabbox / load on demand a CKeditor may be instanciated, but not bound to DOM when triggering VParent.
This cause _isChildOf to find a null parent at the top of the unbound widget branch, and throw an exception.
root cause
while() loop in _isChildOf doesn't have an escape condition if the ckeditor is not currently part of a page.
Workaround
zk.afterLoad('ckez', function() { var xCKeditor = {}; zk.override(ckez.CKeditor.prototype, xCKeditor ,{ _isChildOf: function(wgt) { var p = this.parent; if (p) { do { if (p == wgt) return true; p = p.parent; } while (p != wgt.desktop && p != null); } return false; } });//zk.override });//zk/afterLoad
- relates to
-
ZKCK-40 Memory leak in CKEditor
- Closed