This repros with Firebug 1.7.3 and Firefox 5.0 (and possibly earlier Firefox versions), and also with Chrome 12.0.742.100 with the Drupal for Chrome extension enabled.

Note that this only happens when using the CKEditor module (as opposed to the WYSIWYG module pointed to the CKEditor library) - see http://drupal.org/node/968282 for the issue there. Seems to be an incompatibility between the two modules. They've punted it over here for now.

This happens when creating or editing a node with CKEditor active. When previewing or switching back and forth between text-formats, the following is inserted into the body text:

<div id="drupalforfirebug_general" style="display: none">
	<fieldset>
		<legend>Drupal for Firebug General Messages</legend>There were no messages sent to the general log. Please use &quot;firep($item, $optional_title)&quot; to output messages to this console.</fieldset>
</div>
<div id="drupalforfirebug_sql" style="display: none">
	<fieldset>
		<legend>Query Logging is Not Enabled</legend>Please enable &quot;Display query info&quot; in the Devel Module Settings (devel/settings) to use this feature.</fieldset>
</div>
<div id="drupalforfirebug_hook_form_alter" style="display: none">
	There was no form altering.</div>
<div id="drupalforfirebug_hook_user" style="display: none">
	There was no user processing.</div>
<div id="drupalforfirebug_hook_nodeapi" style="display: none">
	There was no node processing.</div>
<div id="drupalforfirebug_hook_views" style="display: none">
	There was no views processing.</div>
<div id="drupalforfirebug_hook_page_alter" style="display: none">
	There was no page processing.</div>
<div id="drupalforfirebug_php" style="display: none">
	<object data="http://cms.bastyr.edu/admin/firebug/exec" style="width:100%;frameborder=0;height=100%;margin-bottom:-3px;" type="text/html"></object></div>

As far as I can tell, this code is being appended to all html page output (including the body of the editor's IFrame) by the drupalforfirebug_shutdown function. It's also (correctly) being appended to the parent page.

What I can't figure out is why this isn't breaking the WYSIWYG module as well. The drupalforfirebug_exit function checks the content-type before registering drupalforfirebug_shutdown, but neither version of the CKEditor window is setting a content type.

Comments

SandraL’s picture

An update - this is now reproducing with the WYSIWYG module (must have been a cache issue hiding it last week).

As a workaround, I've modified the drupalforfirebug_exit function as follows. This appears to have fixed the problem:

16    // Try not to break non html pages. [from new devel.module]                     
17    if (function_exists('drupal_get_http_header')) {
18        $header = drupal_get_http_header('content-type');
19        if ($header) {
20          $formats = array('xml', 'javascript', 'json', 'plain', 'image', 'application', 'csv', 'x-comma-separated-values');
21          foreach ($formats as $format) {
22            if (strstr($header, $format)) {
23              $dff = FALSE;
24            }
25          }
26        }
          // For CKEditor, check the title to see if this is inside the editor window
          if (strstr(drupal_get_title(), 'Rich text editor')) {
            $dff = FALSE;
          }
      }                    

This works with CKEditor/WYSIWYG - I haven't checked to see whether other configurations and editors set the title in the same way, so this may not be a valid across-the-board solution.

hgmartini’s picture

This issue is happening to me too, with Drupal for Firebug 7.x-1.2 and CKEditor 7.x-1.3, in Firefox 6.0.2 + DrupalForFirebug 0.0.7 + Firebug 1.7.3 or Chrome 14 + Drupal for Chrome 0.4.

frob’s picture

The code above didn't work for me so I modified it to not allow the module to inject html if the WYSIWYG or CKEditor modules are installed. I have committed it to dev. Expect a new release soon.

frob’s picture

Status: Active » Postponed

I have pushed a temporary fix. With the newest version of Drupal For Firebug, it disables its output if the CKEditor module or WYSIWYG is enabled.

This is until a better fix can be found.

ttkaminski’s picture

it disables its output if the CKEditor module or WYSIWYG is enabled

Don't most sites have CKEditor or WYSIWYG installed? Silently disabling DrupalForFirebug in this case, without any warnings displayed in drupal, or any mention on the project homepage is just not very nice.

ttkaminski’s picture

How about only registering the drupalforfirebug_shutdown() function only when the drupalforfirebug_page_alter() is called? I modified the module by setting a global variable in page alter:

global $drupalforfirebug_enable_output;
$drupalforfirebug_enable_output = TRUE;

Then in drupalforfirebug_exit() I replace the ckeditor and wysiwyg exclude code with:

global $drupalforfirebug_enable_output;
if($drupalforfirebug_enable_output !== TRUE) {
  $dff = FALSE;
}

Haven't tested it much, but it works for me.

frob’s picture

Could you post a patch? I would like to look into this.

I did this because it could cause a huge problem for production sites. I am currently working on a new branch that will fix the root cause of this issue.

Silently disabling DrupalForFirebug in this case, without any warnings displayed in drupal, or any mention on the project homepage is just not very nice.

You are correct, it isn't very nice. However, it is posted in several place. I will work on posting a notice to admins that this is going on.

I wasn't worried about it too much because the current version of Firefox is incompatible.

frob’s picture

Assigned: Unassigned » frob

the dev branch now has a perpetual message to alert users that dff is not compatible with the ckeditor or wysiwyg module.

frob’s picture

ttkaminski,

That was a great idea. I tested with and without your snippit and it seems to work. I have commit this to dev, expect a new release soon.

frob’s picture

Assigned: frob » Unassigned
Category: bug » task
Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mmjvb’s picture

This introduces duplicate code and double execution of the code. The conditional (last one added) should be added to the existing code, no need to have code duplicated. You might also correct the comment of the _exit function, currently claims to be of _example !

frob’s picture

@mmjvb, please open a new issue if you see a problem. Patches are also welcome.

I am not really sure what you are referring too. Please open a new issue with more detail.

The dreditor plugin for chrome and firefox offers lots of useful tools for dealing with the d.o issue queue.