[CKEditor Dev] #11986: SetData doesn't load content ckeditor 4.4

832 views
Skip to first unread message

CKEditor

unread,
May 20, 2014, 5:02:31 AM5/20/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-------------------------------+-------------------
Reporter: sashkanz | Type: Bug
Status: new | Priority: Normal
Component: General | Version: 4.4.0
Keywords: setData, ckeditor |
-------------------------------+-------------------
I'm using the following code to populate data, this issue happens in
chrome only,
Jquery dialog opens with ckeditor, clears previous content and loads a new
one with Ajax call.
Sometimes content doesn't load, I able to reproduce it each time I open
chrome developer tool in a background. Just press F12 and open jquery
dialog with ckeditor inside, after opening web developer tool this error
also randomly recreated with developer tool off.
When I debug it I can see that second setData doesn't load Dto.HtmlContent

Chrome version: Version 34.0.1847.137 m
Windows 7
I have disabled chrome plugins.


{{{
function Load(ID) {
ShowEditorDialog();
$('#Dialog').append(loader);
CKEDITOR.instances['CkEditorTxt'].setData("", function () {
PostAsyncAjax("GetData",
{ 'ID': ID},
function (data) {
var Dto = data.d;
CKEDITOR.instances['CkEditorTxt'].setData(Dto.HtmlContent);
$('#Loader').remove();
}
);
});

return false;
}
}}}

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986>
CKEditor <http://ckeditor.com/>
The text editor for the Internet

CKEditor

unread,
May 20, 2014, 5:14:58 AM5/20/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+---------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
-----------------------+---------------------
Changes (by Reinmar):

* keywords: setData, ckeditor =>
* status: new => pending
* version: 4.4.0 =>


Comment:

Could you simplify the test case so we can run it on our machines? It's
impossible to reproduce your TC now because it contains too much of
custom, hidden logic.

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:1>

CKEditor

unread,
May 20, 2014, 5:46:54 AM5/20/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+---------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
-----------------------+---------------------

Comment (by sashkanz):

Here is simplified snippet without hidden logic, PostAsyncAjax is just a
functions that returns html...

{{{
function Load(ID) {


CKEDITOR.instances['CkEditorTxt'].setData("", function () {
PostAsyncAjax("GetData",
{ 'ID': ID},
function (data) {
var Dto = data.d;
CKEDITOR.instances['CkEditorTxt'].setData(Dto.HtmlContent);
}

);
});

return false;
}
}}}

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:2>

CKEditor

unread,
May 20, 2014, 5:59:33 AM5/20/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+---------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
-----------------------+---------------------

Comment (by Reinmar):

Does it call callback synchronously or asynchronously?

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:3>

CKEditor

unread,
May 20, 2014, 6:12:24 AM5/20/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+---------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
-----------------------+---------------------

Comment (by sashkanz):

Asynchronously, I don't think it matters, Every time I debug it I can see
that data.d does get html.
Also when the bug happens ckeditor doesn't load any content - then I'm not
able to type anything until I click view source button - if I do click it
then content does loads.

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:4>

CKEditor

unread,
May 20, 2014, 6:25:01 AM5/20/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+---------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
-----------------------+---------------------

Comment (by Reinmar):

It may not be crucial for your code, but it's crucial for CKEditor,
because you call setData inside dataReady's listener - the correct timing
is very important. Anyway, thanks for details, we'll verify it.

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:5>

CKEditor

unread,
May 20, 2014, 6:27:18 AM5/20/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+---------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
-----------------------+---------------------

Comment (by sashkanz):

Just tested it with synchronously call and got same result.
Thank you.

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:6>

CKEditor

unread,
May 21, 2014, 4:48:18 AM5/21/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+---------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
-----------------------+---------------------

Comment (by sashkanz):

I'm able to reproduce it also with a very simplified snippet
Repro:
1. Page refresh
2. open Chrome developer tool (F12) (if I use Chrome Version 30.0.1599.101
m then the bug happen without opening web developer tool.)
3. execute function Load(ID)

{{{
function Load(ID) {
$('#ckEditorDialog').dialog('open');
CKEDITOR.instances['CkEditorTxt'].setData("test");
return false;
}
}}}

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:7>

CKEditor

unread,
May 21, 2014, 5:04:45 AM5/21/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+---------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: General | Version:
Resolution: | Keywords:
-----------------------+---------------------

Comment (by Reinmar):

I don't have time to check this right now, but I think that your code is
incorrect. When you open a dialog you need to initialize editor
afterwards. I guess you use classic editor which uses an iframe - please
note that iframe does not work if it's detached from DOM. So when you use
CKEditor with dialogs you need to take special precautions against this
problem - initialize editor when your dialog is open and destroy before
closing it.

--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:8>

CKEditor

unread,
Jun 26, 2014, 6:37:02 AM6/26/14
to ckeditor...@googlegroups.com
#11986: SetData doesn't load content ckeditor 4.4
-----------------------+--------------------
Reporter: sashkanz | Owner:
Type: Bug | Status: closed

Priority: Normal | Milestone:
Component: General | Version:
Resolution: expired | Keywords:
-----------------------+--------------------
Changes (by Reinmar):

* status: pending => closed
* resolution: => expired


--
Ticket URL: <http://dev.ckeditor.com/ticket/11986#comment:9>

Reply all
Reply to author
Forward
0 new messages