Closed (fixed)
Project:
FCKeditor - WYSIWYG HTML editor
Version:
master
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2005 at 17:05 UTC
Updated:
12 Sep 2006 at 17:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
Vidarls commentedSomehow everything behind F in the title got lost in the first post, sorry about that.
-Olegu
Comment #2
Vidarls commentedUpdated,
Now using hook_form_alter instead of hook_elements.
Somehow it works better with Firefox now than it did while using hook_elements. It seems to have eliminated a problem with Drupal not recognicing FCkeditor as the Body field.
Allso, access control and browser compatibility check should be working now.
Still I have not been able to produce a patch, so it's still the complete .module file.
-Olegu
http://www.zbz5.net
Comment #3
scroogie commentedI can create the patch of your module if you want. Against which version shall i create it? Did you alter the latest revision from CVS?
Comment #4
Vidarls commentedI used the latest release (4.6.0, 30/04/2005 - 07:15) link from the project page, I tried the CVS version aswell, but it seemed to be the same file. But to be sure use the (4.6.0, 30/04/2005 - 07:15) version to make the patch.
Thanx.
Comment #5
scroogie commentedOkay, this is the patch against 4.6.0, 30/04/2005 - 07:15.
A patch against HEAD will follow.
Comment #6
scroogie commentedHere it is. That was a bit stressfull, because of the popup option and there was an error in fckeditor_config_string, namely FCKEditor apparently needs an absolute path to the SkinsDirectory instead of a relative.
Tried it on my 4.7 b2 installation and works (including the popup option).
Comment #7
simon rawson commentedI've just manually patch the fckeditor.module and the settings pages now work. I have installed the FCKeditor sources into the modules/fckeditor/lib directory and given myself access permissions to "use fckeditor".
However, I still can't get FCKeditor to appear on any of my textareas...
Any handy hints for making it work with 4.7?
Simon
Comment #8
maxiorelTo simon rawson: The only working solution for me and Drupal 4.7 beta 4 was fckeditor_1.module from olegu. Later updates a patches seems doesn't work.
Comment #9
a39wk1lkdmn commentedCan't get it to work against 4.7 Beta 4. I downloaded the fckeditor cvs from 2/24 and tested, then switched out fckeditor.module for the others on this page. Here's the results:
fckeditor.module from 2/24 cvs: The new floating textarea from Drupal appears; no fckeditor visible.
fckeditor_1.module: Image of entire page appears within the text editor. For example, if I click on 'story' from the Create Content page, an image of the Create Content page appears in the textarea of the story submission page. Wierd.
fckeditor_2.module: Reverts back to the floating textarea; no fckeditor visible.
Hopefully this feedback will help someone figure out the issue; I'm still at the "theme modifier" stage of Drupal development skills. ;-)
Thanks,
Randy
Comment #10
stefano@tipic.com commentedThe attached module is an updated version of the CVS fckeditor.module, it works on the latest CVS version.
This module allows administrators to set two available modes for fckeditor: replace textarea and/or popup window. The choice is shown as links in the description below the textarea.
The fckeditor is not loaded at startup, so the basic textarea is preserved in every page. It's up to the user to choose whether use the basic textarea or switch to the wysiwyg editor in the available modes.
The popup option requires the file /lib/fckpopup.php, you can find it in the CVS.
This module also allows administrators to set different toolbars for nodes and comments. Comments may require just a few buttons, there's no need to show a full toolbar like the one you may need for nodes.
I recommend to edit the fckconfig.js file and add two toolbar sets:
FCKConfig.ToolbarSets["Nodes"]
FCKConfig.ToolbarSets["Comments"]
The module already has Nodes and Comments in the toolbar choices.
Comment #11
cooperaj commentedUsing the patch 5 given above I've managed to get FCK editor to work. The trick in getting the popup to work is to name the full base path in the settings for fckeditor. i.e. '/drupal/modules/fckeditor/lib', however by doing so you break the textarea replace.
Looking at the source for a loaded page you'll find that the javascript that the module needs to work has been incorrectly addressed. It's been called as '/drupal//drupal/modules/fckeditor/lib/fckeditor.js'. At some point during the page creation process '/drupal/' is prepended to the passed entry.
I've narrowed this down to a drupal api call, 'drupal_add_js()'. I could do a bit of wizardry to check for a pre-existing '/drupal/' part and remove it from the path before passing it to this call. But I'm not that good. So instead I've simply changed fckeditor.module:
Yay, a hardcoded path.
Comment #12
jake123 commentedI suspect the number of end user's who lack an html sense and need a friendly editor is bigger than the 8% older browser users indicated by net wide user stats.
Having a browser/OS detect scheme that accesses the standard DruPal text edit page, rather than FCKeditor would avoid an ugly fatal script error message.
My brief test experience was with the external library demos run on Explorer 5 for Mac.
Comment #13
Kieg Khan commentedHello,
I have been hoping to get fckeditor going again after upgrading to 4.7.0beta3. I have been using tinymce and find it is a bit more fussy than the fckeditor was.
I have tried all of the module_1, _2 & _5 patches with the following results:
Module 1 & 2 work on my system, but only on the main body textareas, not on any of the other textareas. Tinymce works on all text areas, so it is a better choice at this stage.
Module 5 did not work very well on my system. It would display on every textarea, but there would not be any control icons and also a few extra textareas, not in the original form, would appear (eg: one right below the teaser, but it is not the body or the teaser).
I could not replicate it consistently, but sometimes when I click the submit button the changes to content are not applied. This could have something to do with the extra textareas that are appearing.
I tried to have a look at the .module, but the differences between 1 & 5 are pretty big and beyond my limited understanding of PHP.
Please keep working on this module as it is, IMHO, the best WYSIWYG editor that I have used.
Thanks.
Comment #14
Kieg Khan commentedI also get the following errors when I use module_5 with the suggested hard coded path
Notice: Undefined variable: HTTP_GET_VARS in c:\Inetpub\wwwroot\drupal4.7\modules\fckeditor\lib\fckpopup.php on line 28
Call Stack
# Function Location
1 {main}() c:\Inetpub\wwwroot\drupal4.7\modules\fckeditor\lib\fckpopup.php:0
This error occurs 3 times, once for each $HTTP_GET_VARS entry in fckpopup.php file.
So this error, plus the graphic images for the icons are missing, they display as place holders only.
Thanks.
Comment #15
Kieg Khan commentedHello,
After following your instructions I got the editor working on 4.7.0b3 by changing the $HTTP_GET_VARS to $_GET.
Now I have updated to 4.7.0b5 and the editor has failed again. fckeditor is a very fickle bit of software under Drupal.
The error now is an error on page and it reads Object doesn't support this property or method.
URL .../editor/fckeditor.html?
I had the editor going by changing the relative path but there were no icons, now it is broken again.
Drupal settings for fckeditor is modules/fckeditor/lib/ and code change in fckeditor.module for adsolute path in the Drupal_add_js code.
Any help is appreciated thanks.
Comment #16
behindthepage commentedThis a version of fckeditor_2.module from above that works on 4.7 beta 6. It behaves exactly as the 4.6 version does i.e. replaces the body textarea when editing a page or story etc. The trick was in hook_form_alter on line 65 - identifying the part of the form array properly with ['body_filter']['body']['#suffix']
Comment #17
jlin commentedThe editor does show up in 4.7.0 b6, however, when using clean url's, the iframe is replaced by a rendering of the front page of the site. Hard to explain, but the textarea box doesn't show up.
Comment #18
behindthepage commentedI found that I needed to use the path /modules/fckeditor/lib/ on linux to solve this problem.
Comment #19
klance commentedThanks, gpdinoz. I think this has something to do with changes to $base_url to allow for the use of relative paths. I had to add a leading slash to FCKEditor's path to get it to reappear after it disappeared when I applied this patch to 4.6.5.
Comment #20
behindthepage commentedDefinately a base_url thing.
I have found that this module works OK in FF but not in IE. Let me know if you have any problems.
Comment #21
gte451f commentedEditor doesn't work in RC2 when using the fckeditor_6.module
I am getting the error:
I have checked and double checked the path and it is pointing directly to that html file.
Comment #22
neofactor commentedSame here..... but I fixed it by putting all of the content from the FCK editor download and putting it into the lib folder.
Comment #23
hutch commentedI have downloaded all the examples found in this thread, and have cobbled together a version that has features from several of them plus a few of my own.
It's been tested on a couple of Linux boxes, but could no doubt do with more. It's been running on drupal-4.7.0-rc2 and It did not fall over on drupal-4.7.0-rc3 which I installed an hour ago.
Comment #24
intu.cz commentedThe fckeditor_5d.module doesn't work with my RC3 installation. It didn't work with the beta there was before either. The FCKeditor is version 2.2 and the module code is from the CVS.
First, it took me ages to realize that I need to rename the fckeditor_5d.module to fckeditor.module for it to work. I tried all sorts of things suggested here and a few other module versions from here but best result I got was:
The node/add/page displays the options (textarea or pop up). Whatever I choose I get the content of node/add/page displayed instead of the editable content or empty space and NO MENU appears...
The Base Path in the settings is set to
modules/fckeditor/lib/which seems to be the only correct path so that the module finds the menus.What could be wrong? Could anyone please provide a HOWTO on how to make this work? It's quite an important module for many people...
Thanks for any help
Roman
Comment #25
hutch commentedOK Roman, I will try to talk you through it
I attached the most recent version, which has a few fixes in it and has the settings page reorganised.
Put fckeditor_5f.module into modules/fckeditor/ and rename it fckeditor.module. Ensure that it has permissions by running
chmod 755 fckeditor.modulefrom the modules/fckeditor/ directory.
Check that fckeditor is installed correctly. You should have the following in modules/fckeditor/
lib
ssip
LICENSE.txt
README.txt
fckeditor.module
Run drupal and log in as admin. Go to administer > modules and check that fckeditor is enabled.
Go to administer > settings > fckeditor and check 'Textarea replace', leave the others blank for now.
Go down to the bottom of the settings page and do the same for 'Admin settings'
Hit 'Save Configuration'
If you have phpmyadmin or similar installed have a look at your database, table 'variable' and look for lines starting with 'fckeditor' in the 'name' column. There should be 18 of them.
Go to 'create content and hit 'page'
look at the bottom of the textarea box and there should be a link 'Use wysiwyg editor: in textbox'
If you click on that it should work.
If it doesn't have a look at the source of the page and look for a piece of javascript something like this:
Your paths, skins and toolbarsets might be different, but they should exist.
have a look at fckconfig.js and make sure that is correct
The popup in my opinion is no good, but it might work under other browsers (I'm using firefox)
If you have a javascript console tool use that to see if any errors appear
The 'nolink' option should make the editor appear automatically, but don't try that until you have got the above method working first.
the 'bodyonly' option should limit fckeditor to textarea boxes named 'Body'
and Good luck!
Comment #26
intu.cz commentedThanks for the instructions, I followed them and checked the database. No errors on the JavaScript console in Firefox. However, I am getting the same problem - no toolbar, no text to edit, just the content of the previous page. Here is my JavaScript:
It seems that the path to the Skins (
oFCKeditor.Config["SkinPath"] = "/modules/fckeditor/lib/editor/skins/office2003/";) is the main difference when compared to the code in your message. Should I put a hardcoded path into fckconfig.js? I'll try that but what I am wondering is if there is a cleaner way to do it. Lots of other things in the fckconfig.js seem to have the same path structure...Thanks again,
Roman
Comment #27
intu.cz commentedAfter changing everything back and forth I discovered that the fckeditor.module set up as detailed in your instructions works, but ONLY WITH CLEAN URLs SWITCHED OFF. How can I modify the module so that it works with Clean URLs?
Roman
Comment #28
hutch commentedoh dear:
"but ONLY WITH CLEAN URLs SWITCHED OFF"
I have no idea. Does the javascript appear in the source with 'clean urls on'?
oh well, two steps forward but one step back, at least we've discovered what does not work ;-(
Comment #29
intu.cz commented(Sorry for the uppercase letters -- I wasn't shouting, it was the enthusiasm of seeing it work after so many difficulties...)
Do you mean the code between
<script type="text/javascript">and</script>? It does appear, I pasted the code from the clean URLs version on this page under < a href="http://drupal.org/node/41288#comment-91551">#26.Comment #30
hutch commentedI know very little about mod_rewrite, so I can't help much, however I set up .htaccess and enabled Clean URLs just to see what happens.
When I attempt to create a page It loads the whole of drupal into the textarea box, utterly bizarre! So I switched it off again real quick. ugh.
Clearly, to use fckeditor with Clean URLs is going to require another way of bringing on the javascript. The strange behaviour occurs both with the 'textbox' link or with 'automatic' mode.
Pity, because Clean URLs is a very good idea which will keep the search engines happy and it works very well otherwise.
That's javascript for you ;-(
Comment #31
hadishon commentedHas anyone found a work around for this yet?
Comment #32
yueyuezhou commentedI got following error. Any clue?
Type page not found
Date Friday, April 28, 2006 - 23:24
User yzhou
Location /modules/fckeditor/lib/editor/fckeditor.html?InstanceName=edit[body]&Toolbar=Default
Referrer http://yzhou.anywhere.com/?q=node/add/page
Message modules/fckeditor/lib/editor/fckeditor.html not found.
Severity warning
Comment #33
centipod commentedfckeditor_5f_0.module worked fine, but when I hit "submit" it doesn't jump anywhere. Just a blank page. This is with mozilla 1.5
Hitting "back" and selecting any menu seems ok. The page was indeed saved as modified by fckeditor. But I do see the following on the next page I go to:
warning: Cannot modify header information - headers already sent by (output started at /var/www/html/modules/fckeditor/fckeditor.module:524) in /var/www/html/includes/common.inc on line 265.
But this is probably just left over from not finishing the last page that was started.
I am running 4.7RC3
Thanks for any help getting this going. 4.7 has neat features, and I cant see giving my wife and friends, etc, a drupal without fckeditor. Its essential!
Comment #34
hutch commentedIf by mozilla 1.5 you mean firefox 1.5, that's what I tested fckeditor on.
You could try flushing the cache in your browser, might help.
warning: Cannot modify header information - headers already sent by
(output started at
/var/www/html/modules/fckeditor/fckeditor.module:524) in
/var/www/html/includes/common.inc on line 265.
Is this consistent?
line 524 in fckeditor.module is in the thick of the settings form, nothing to do with usage in a textarea box. weird.
Comment #35
ag-1 commentedIn case anyone stumbles across this that only needs to get FCKeditor working in drupal, without the access capabilities, etc.
Just paste this into the top of your theme template, before the closing tag.
Comment #36
skrat-1 commentedThere is a bug in module/patch fckeditor_5f_0.module
oFCKeditor.BasePath should have absolute path, starting wiht /
Line 187 should look like this:
oFCKeditor.BasePath = "/' . $fck_config['BasePath'] .'";
Than it works with mod_rewrite engine enabled as well.
Comment #37
deadmalc commentedThat doesn't seem to do the trick for me, I just get the home page displayed in the text box :-( and no errors that I can see, yet works a treat without clean URL's (v4.7.1 of drupal)
Comment #38
ADMarshall commentedThis, from above, didn't work for me either:
oFCKeditor.BasePath = "/' . $fck_config['BasePath'] .'";It put the whole page into the box where the editor should have been, without any of the editor toolbars displaying.
Yet when Clean URLs are disabled, fckeditor_5f_0.module also seems to work fine for me under Drupal 4.7.0.
Has anyone gotten this patched module (or other) to work with Clean URLs yet?
Please, please help the PHP/Javascript challenged, like me.
Comment #39
stefano@tipic.com commentedI want to share my latest version of fckeditor.module. I didn't apply some of the changes I saw in the versions _5x, like the superuser option and the exclude pages, cause I think they're too much "admin-only".
I added an autoreplace box, allowing you to let some textareas on specific paths be autoreplaced. For example, if you want to autoreplace the "edit[body]" textarea in the "node/add/page" path, you enter the line node/add/page|edit[body]. This makes the exclude pages option useless, because all textareas are not autoreplaced by default, and you can set to autoreplace only the ones you really need.
Comment #40
stefano@tipic.com commented... just added </code> ...
Comment #41
paddy_deburca commentedI just installed your module on a 4.7.2 installation and all is well. I tried to make the module work myself - but with all the API changes since 4.6, using yours was a lot easier.
My only comment, though. My log shows errors with array handling on lines 231 and 234. I put a couple of tests around the effected lines and no more error messages in the log.
I can submit a patch it you wish.
Thanks,
Paddy.
Comment #42
stefano@tipic.com commentedI think an array cast is a better solution:
Updated module attached.
Comment #43
stefano@tipic.com commentedMade some changes to my previous fckeditor.module:
New fckeditor.module attached.
Comment #44
thierry_gd commentedAnother version of this module has been provided on http://drupal.org/node/41288
Comment #45
thierry_gd commentedI tried fckeditor_16.module (9.92 KB) ==> don't work for me
Comment #46
thierry_gd commentedI had been a little fast saying it didn't work for me ==> it do now work
Comment #47
rose commentedIt work for me too. Only open in new window has error.
Notice: Undefined variable: HTTP_GET_VARS in C:\AppServ\www\drupal\modules\fckeditor\lib\fckpopup.php on line 28
Notice: Undefined variable: HTTP_GET_VARS in C:\AppServ\www\drupal\modules\fckeditor\lib\fckpopup.php on line 31
Notice: Undefined variable: HTTP_GET_VARS in C:\AppServ\www\drupal\modules\fckeditor\lib\fckpopup.php on line 34
Comment #48
hutch commentedNotice: Undefined variable:....
that is fixable
edit
to
I haven't tested it but I think it will work
HTH
Comment #49
rose commentedThank indeed hutch. It solved.
Comment #50
ontwerpwerk commented4.7.3 is out now...
Comment #51
(not verified) commented