I got tired of Firefox memory leaks and I recently switched over to Safari 4 Mac beta. Everything has been great for two weeks until I realized that when I edit a node and leave a FCKeditor field empty, nbsp gets entered for the value.

I cleared the field and then went through the same steps with Firefox 3 Mac and it I did NOT get a nbsp when the field was empty.

Huh.

I guess I could intercept the form on submit and remove any fields equal to  , but that's hackish.

Comments

Jorrit’s picture

This looks like a bug with FCKeditor. Could you see if it also happens when you use FCKeditor outside Drupal?

mumedia’s picture

Version: 6.x-2.0-beta1 » 6.x-1.3

I have noticed this problem myself when I have an empty CCK textarea.

I'm running the following:
FCKeditor: 2.6.4.1
Firefox: 3.0.11

I tested this in IE7, and there was no issue with the $nbsp appearing.

Jorrit’s picture

Does it happen with non-CCK textareas?

Jorrit’s picture

Status: Active » Postponed (maintainer needs more info)
capellic’s picture

Yes, it does. I just ran a test with Safari 4.0.3. I added a page without entering anything in the Body field (core, non-CCK). The Body field has the FCKeditor on it. After submitting, I viewed the source and   is in there where the body would be.

This also appears on comments if FCKeditor is enabled for comments.

Another interesting observation is that that there is a space in the FCKeditor field when the page loads. When I click in to the FCKeditor field, I noticed that a space is already present. I took a look at the code, and there is no space there:

<textarea cols="60" rows="20" name="body" class="form-textarea resizable fckeditor"></textarea>

This would lead my to believe that the space is being added by FCKeditor when it's loading, after the HTML element has already been loaded?

Then, should you hit submit without removing the space, the &nbsp; gets insert into the database. Of course, if Drupal core would do an rtrim on all input fields, then we wouldn't be dealing with this issue. I just did a search for "drupal module trim" and "drupal module rtrim" and didn't find any contributed module for this -- odd -- that's an idea for my next module!

Jorrit’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I think it is an incompatibility between safari and FCKeditor 2. Please try CKeditor and the wysiwyg Drupal module in the meantime.

zilverdistel’s picture

subscribing.

Same problem here, in Safari, but also in Chrome.