i have found that images are uploaded to a directory higher than the drupal install. I previously raised this here - http://drupal.org/node/97694

For example, for a site installed at:

http://sandbox.mysite.com/drupal

the files/images folder should be:

http://sandbox.mysite.com/drupal/files/images

What actually happens is FCKeditory loads the files here:

http://sandbox.mysite.com/files/images

I have also tried this locally using MAMP (where i first detected the problem, then tried in as a sandbox site)...

Indicative of the problem, images uploaded with IMCE are in the correct directory and through FCKeditor you cannot access these as it goes to the higher directory...

Comments

Wouter Van den Bosch’s picture

I'd like to confirm this.

I was trying to figure out why I couldn't upload images through FCKEditor with IMCE installed. I could upload images through the My Account tab, without problems, but via FCKEditor I kept getting error messages stating that there were insufficient access rights for the given folder.

Following this bug report, I made a directory higher than my drupal install, named files/Image; gave it full rights and FCKEditor allowed for uploads this time, upping them to the wrong directory alas.

Cheers,
Wouter

ontwerpwerk’s picture

Some questions about your configuration:

  1. what is your drupal files directory, and can you upload files as attachments
  2. did you edit ..modules\fckeditor\lib\editor\filemanager\browser\default\connectors\php\config.php as specified in the readme
  3. how does the fckeditor code look in the page itself (view source and look for new FCKeditor)
Wouter Van den Bosch’s picture

1. My files directory is just 'files' within my drupal directory (set to 777) and regular uploads pose no problems. I am also perfectly able to upload images through the IMCE interface unde 'My Account'.

2. Yes.

3. how does the fckeditor code look in the page itself :

<script type="text/javascript">
var oFCKeditor_edit_body = new FCKeditor( 'edit-body' );
oFCKeditor_edit_body.BasePath	= '/idtv/modules/fckeditor/fckeditor/';
oFCKeditor_edit_body.Config['CustomConfigurationsPath'] = '/idtv/modules/fckeditor/fckeditor.config.js';
oFCKeditor_edit_body.ToolbarSet = 'DrupalFull';
oFCKeditor_edit_body.Height = '480';
oFCKeditor_edit_body.Config['LinkBrowserURL'] = '/idtv/modules/fckeditor/fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath=/files';
oFCKeditor_edit_body.Config['ImageBrowserURL'] = '/idtv/modules/fckeditor/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath=/files';
oFCKeditor_edit_body.Config['FlashBrowserURL'] = '/idtv/modules/fckeditor/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath=/files';
oFCKeditor_edit_body.Config['LinkUpload'] = false;
oFCKeditor_edit_body.Config['ImageUpload'] = false;
oFCKeditor_edit_body.Config['FlashUpload'] = false;
</script>
<script type="text/javascript">
  oFCKeditor_edit_body.ReplaceTextarea();
</script>

When I experiment with changing "...&ServerPath=/files" into "...&ServerPath=/idtv/files" on all three lines in the module (idtv is my drupal directory), it does post the images into the correct folder. Sadly enough I still don't get the IMCE interface, but that might be related to another issue I take it.

Cheers,
Wouter

ontwerpwerk’s picture

If you change the following:

    // get the default drupal files path
    $files_path = file_directory_path();

to

    // get the default drupal files path
    $files_path = base_path() . file_directory_path();

will it work then?

ontwerpwerk’s picture

I looked into it a bit more.. and it should work that way, I'll update the module soon.

The following lines must be changed a little too (the leading slash before ServerPath must be removed)

$element['#suffix'] .= $js_id.".Config['LinkBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php&ServerPath=".$files_path."';
".$js_id.".Config['ImageBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php&ServerPath=".$files_path."';
".$js_id.".Config['FlashBrowserURL'] = '".$module_full_path."/fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/php/connector.php&ServerPath=".$files_path."';
ontwerpwerk’s picture

Assigned: Unassigned » ontwerpwerk
Status: Active » Fixed

these changes are committed to the latest 5.x and 4.7.x versions of the module

avolve’s picture

i just wanted to say thanks!

[and sorry for not looking back on this sooner and testing your suggestions...]

Permanently Undecided’s picture

Status: Fixed » Active

Hello! This problem is still occurring for me. I downloaded the most recent cvs version:
// $Id: fckeditor.module,v 1.19 2006/11/13 19:21:39 ontwerpwerk Exp $
and the files still get loaded one directory higher. The lines that you mentioned needing changing are still the same, too. It's like the commit you mentioned on #6 didn't happen?

ontwerpwerk’s picture

Status: Active » Fixed

for drupal 5.x the version that includes this fix is the following or greater

// $Id: fckeditor.module,v 1.19.2.1 2006/11/21 09:18:15 ontwerpwerk Exp $

( http://drupal.org/files/projects/fckeditor-5.x-1.1.tar.gz )

and for drupal 4.7.x it is

// $Id: fckeditor.module,v 1.18.2.1 2006/11/21 08:58:14 ontwerpwerk Exp $

( http://drupal.org/files/projects/fckeditor-4.7.x-1.1.tar.gz )

please recheck your downloads

Permanently Undecided’s picture

Thanks for the link, ontwerpwerk. I generally download head code directly from cvs and this page:

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/fckeditor/

still shows the old version (revision 1.19 dated 13 days ago). I didn't know there was a place with more updated code than that. Thanks and sorry for the confusion.

Permanently Undecided’s picture

Addendum: and I now see where the problem is! If one does a cvs checkout of the directory, one downloads, for reasons beyond my understanding:

Revision 1.19 - (view) (download) (annotate) - [select for diffs] 
Mon Nov 13 19:21:39 2006 UTC (13 days, 4 hours ago) by ontwerpwerk 

instead of downloading the latest version, which is called:

Revision 1.19.2.1 - (view) (download) (annotate) - [select for diffs] 
Tue Nov 21 09:18:15 2006 UTC (5 days, 15 hours ago) by ontwerpwerk 

I have no idea why the cvs checkout doesn't download 1.19.2.1 as it should. Sorry again, ontwerpwerk.

ontwerpwerk’s picture

since the new release system is in place you will need to download the dev version of one of the branches.

Anonymous’s picture

Status: Fixed » Closed (fixed)