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

CKEditor: 7.x-1.16, CKEditor Media: 7.x-1.x-dev, jQuery_update module loading jquery 1.8

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

Please help me fix that issue

Answer:

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-&gt;type=="webform" &amp;&amp; $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
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 &quot;DrupalBreak&quot; was added to Used button list.
solution 1:
Go to CKEditor profile settings page at '/admin/config/content/ckeditor/edit/[profile_name]'
Switch of &quot;Plugin for inserting Drupal teaser and page breaks&quot; in appearance settings.
Make sure, that &quot;DrupalBreak&quot; 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 &quot;search_index&quot;, no redirects should be made. (the easiest way is to just return $node if($view_mode == &quot;search_index&quot;)