Not all of the textarea fields correspond to HTML data, so in an attempt to narrow down the textareas that FCKeditor swaps out, I've added a feature to only swap out textareas named 'body' rather than all of them.

It adds a setting for "Only affect 'body' areas". If this is true, then only textareas named 'body' will be swapped.

This method is not fool proof, for instance on the edit block page (admin/block/configure/block/1), the area for editing block content is called 'body' and with the FCKeditor enabled, any PHP in the textarea will get wiped out.

So I'm open to suggestions if anyone has 'em.

This is my first patch for a Drupal module, so please let me know if I've done anything incorrectly.

Hope my patch is helpful!

-Jeff

CommentFileSizeAuthor
fckbodyonly.patch1.56 KBjjeff

Comments

slower’s picture

This patch fails using the 4.5 version of fckeditor.module.

[zuma]$ patch -p0 <fckbodyonly.patch
patching file fckeditor.module
Hunk #1 FAILED at 49.
1 out of 1 hunk FAILED -- saving rejects to file fckeditor.module.rej
missing header for unified diff at line 30 of patch
can't find file to patch at input line 30
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
|
|-      if ( fckeditor_is_compatible_client() && $access ) {
|
|+      if (fckeditor_is_compatible_client() && $access && $doit) {
|
|               if ( $op == 'pre' ) {
|
2|                       $output = '';
|
|               }
|
--------------------------
jjeff’s picture

Actually, I made the patch on the CVS version.

Don't know what the differences are between CVS and 4.5.

I could have messed up the diff, but I followed the instructions here.

-Jeff

slower’s picture

Just installed the CVS version of fckeditor.module and the patch still fails.

tulula’s picture

I needed a patch like this for my BLOCKS only, now it's affected all Body areas for all content.

Any other go around for my php filled blocks? I need this for my add/edit content areas still.

Lisa

jjeff’s picture

I think I've abandoned attempting to guess the names of textareas. Instead I've written another patch that adds a JavaScript "WYSIWYG" link below each textarea. Click it and the textarea gets replaced with the FCKeditor. Easy. And a lot more flexible.

-Jeff

ontwerpwerk’s picture

Status: Active » Closed (won't fix)

we took another approach