Error: p is null
Source File: http://www.website.com/ckeditor31/ckeditor.js
Line: 106
How am I generating this?
I am using jquery datatables to load a list of items, There is an edit button for these items. When the edit button is pressed for an item it sends an ajax request to the server and creates a jquery.ui popup that is loaded with the return data. That data contains HTML forms to be completed. The forms are placed into a jquery.ui tabbed set in the modal.
The first tab contains selects, radio buttons, checkboxes, text entry and a pair of jquery.ui sliders.
The second tab contains two text areas that are preloaded with HTML and are supposed to be converted to ckeditor text areas.
The javascript to do this is:
<script type="text/javascript"> function loadEditor(id) { var instance = CKEDITOR.instances[id]; if(instance) { CKEDITOR.remove(instance); } editor = CKEDITOR.replace(id, { filebrowserBrowseUrl : '../ckfinder/ckfinder.html', filebrowserImageBrowseUrl : '../ckfinder/ckfinder.html?type=Images', filebrowserFlashBrowseUrl : '../ckfinder/ckfinder.html?type=Flash', filebrowserUploadUrl : '../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files', filebrowserImageUploadUrl : '../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images', filebrowserFlashUploadUrl : '../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash' } ); var instance = CKEDITOR.instances[id]; CKFinder.setupCKEditor( instance, '../ckfinder/' ) ; }
a bit later in the code the following is run
<script type=\"text/javascript\"> $(function() { loadEditor('textarea2'); loadEditor('editor_kama'); });
the code for the textarea is:
<tr> <td colspan=2 valign=top>Question: (HTML Required)<br><textarea class=cke1 id=\"editor_kama\" cols=50 rows=6 name=qhtml>".$qrow['qhtml']."</textarea></td></tr> <tr> <td colspan=2 valign=top>Explaination: (HTML Required)<br><textarea id=\"textarea2\" cols=50 rows=6 class=cke1 name=qdeschtml>".$qrow['qdeschtml']."</textarea></td></tr>
Now here is where it gets funky.
The first time I load the jquery.ui popup with the text I get the error above, but only once. Then both textarea's are blank. If I close the popup and reopen it by selecting an edit button, ckeditor is correctly loaded in BOTH text areas. The only time this fails and gives the "p is null" error is the very first time the jquery.ui popup is called an the editors are loaded (and fail to load). All calls after that function with no errors. This is a repeatable process (unfortunately).
So, what is causing the first invocation to generate the error and does anyone have suggestions on how this can be overcome.
Thank you in advance for your help and support.
Has anyone resolved this
Has anyone resolved this issue yet? I found this ticket, but no fixes seem to have been made...
http://dev.ckeditor.com/ticket/8545v