Closed (duplicate)
Project:
Wysiwyg
Version:
6.x-2.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2010 at 13:45 UTC
Updated:
27 Oct 2010 at 15:53 UTC
How to can solve this.. I'm using the ckeditor and if I press the preview button, the editor disappears.
Comments
Comment #1
Apfel007 commentedany suggestions?
Comment #2
twodAre you using Firefox? If so, this might be a duplicate of #920500: Firefox refresh breaks editor load and #693694-4: Firefox: Editor fails load to when reloading a form with enabled editor (Comment #4 has some details on why this happens, FF bug).
Those issues are about refreshing the page, but preview does almost the same thing, so maybe the browser tries to select the same elements that were selected before, and fails.
Which version of CKEditor are you using?
Are you seeing any JavaScript errors before/after the page has reloaded?
Comment #3
szantog commentedNo, this is cross browser error. I tried with uid1, another user, browsers chrome, ie8 and ff, i switched back to garland, and i cant see the ckeditor, after click the preview.
I get a js error: x.config.skin.split is not a function
[Break on this error] if(o)o.uiItems.push(p);return p;},addH....updateElement();};z.on('submit',A);
on ckeditor.js line 23
I don't know the editor too deep, but i've found this: https://drupal.org/node/313497#comment-2372622, so i think, in hook_nodeapi preview something miss. Sorry, this module is too complex to my knowlegde to debug..
Comment #4
twodDo you know if you are using any module which implements hook_wysiwyg_editor_settings_alter() or adds editor plugins via hook_wysiwyg_plugin() or hook_wysiwyg_include_directory()? If so, please post the code from those hooks.
If you are using the code from the comment you linked to, please read further down that issue to find out how to do the same thing from an hook_wysiwyg_editor_settings_alter() implementation instead.
Wysiwyg doesn't do anything special for preview mode so I'm not sure where to start debugging this. It does need to initialize the theme when data has been posted to grab some stylesheets, but that shouldn't cause this error.
What is the value of
Drupal.settings.wysiwyg.configs.ckeditor.format#.skin(where # is the id of the input format the editor is attached to) when the page is previewed?You can check this using the DOM tab in Firebug for Firefox or by simply pasting
javascript:alert(Drupal.settings.wysiwyg.configs.ckeditor.format#.skin)in the address field.Comment #5
szantog commentedI checked the DOM, and the difference is, the Drupal.settings.wysiwyg.configs.ckeditor.format# the items of this object are always array, because all of parameters are double.
http://www.screencast.com/users/szantogabor/folders/Jing/media/d431e504-...
Well, I forgot, I applied this patch #507696: Allow individual width/height per field. this causes the problem. This patch drops the static $formats = array() line, and in preview the drupal_add_js merge the objects, in my think..
So this issue would be duplicated?
Comment #6
twodYeah, it's drupal_add_js() which merges the settings because they get processed multiple times.
Thanks for changing the status on #507696: Allow individual width/height per field, it does need work to consider this case, and perhaps a bit of refactoring as well. Yes, I'd consider this a duplicate - or at least a consequence of - #507696.