ckeditor loads all the page html while editing not only the body field

I have strange issue with ckeditor that it loads all page source including (header, menu, body, footer ...) not the node body field itself.

the problem may have relation with default search module as it disappears when I re-index the site till the index built again.

I tried many links and that question but nothing works for me.

I tried jquery_update but didn't make any change BTW I see the body field content before the ckeditor loads after that the field content becomes all page source

I checked ajax requests and found that /ckeditor/xss returns the whole page content.

The solution in my case was based on zhilevan answer solution 2

just added checking for the $view_mode like: function my_module_node_view($node, $view_mode,$langcode){
if ($node->type=="webform" &&$view_mode != 'search_index'){
//Do some stuff here
}


solved the issue without the need to disable the search module

Also solution 1 :Switch of "Plugin for inserting Drupal teaser and page breaks" didn't make sense and I think it have no impact here

• Need more info. Any errors in your php error logs? – othermachines Sep 6 '15 at 21:27
• Check your markup if all elements are properly closed – Gulok Sep 7 '15 at 2:37

I had this problem some month ago, one solution with disabling search module was good, but now i've needed search-box working, so i've made a research and found another thing.

In my case the problem was Plugin for inserting drupal teaser and page breaks. I've had this plugin switched off, but button "DrupalBreak" was added to Used button list.

solution 1:

Go to CKEditor profile settings page at '/admin/config/content/ckeditor/edit/[profile_name]'
Switch of "Plugin for inserting Drupal teaser and page breaks" in appearance settings.
Make sure, that "DrupalBreak" button is not in use.

solution 2:

The problem most likely lies within the search-module's cronjob to index the page. This cronjob kind of views the nodes it wants to index. If you use hook_node_view() anywhere in your modules and the cron-user gets an error or gets lead anywhere by a drupal_goto(), the behaviour you described is the result.
Solution: Disable the search-module if you don't need it. If you need it though, check the $view_mode in your hook_node_view()-implementations. If it says "search_index", no redirects should be made. (the easiest way is to just return$node if($view_mode == "search_index") • @Mhmdgomma you're welcome, We are here to help each other – Yusef Sep 8 '15 at 4:28 This might help: • Check the version of jQuery required by your donwload of CKEditor • Install the jquery_update module • Choose a vesion of jQuery that will work with CKEditor from that module's configuration page. (I find 1.8 works well with most contrib modules) • I tried jquery_update but didn't make any change BTW I see the body field content before the ckeditor loads after that the field content becomes all page source – Mohammed Gomma Sep 7 '15 at 5:54 The solution in my case was based on zhilevan answer solution 2 just added checking for the$view_mode like:

function my_module_node_view($node,$view_mode, $langcode){ if ($node->type=="webform" && \$view_mode != 'search_index'){
//Do some stuff here
}


solved the issue without the need to disable the search module

Also solution 1 :Switch of "Plugin for inserting Drupal teaser and page breaks" didn't make sense and I think it have no impact here

• Glad you got it solved. You should edit your original post so that people can find this info instead of adding an answer. Cheers - – othermachines Sep 7 '15 at 19:34