Jump to content

Fix for FCKEditor image upload problem


Guest sheik

Recommended Posts

Guest sheik

When I edit one of my content pages, and click the insert image tool icon, a popup window appears. If I click "Browse" on this window (to browse the CubeCart server for available images) the resulting pop up is broken.

The URL looks like:

http://www.mysite.com/admin/includes/rte/e...&Connector=http%3A%2F%2Fwww.mysite.com%2Fadmin%2Fincludes%2Frte%2Feditor%2Ffilemanager%2Fconnectors%2Fphp%2Fconnector.php

The bold section is incorrect, and is caused by the link being generated with FCKEditor's FCKConfig.BasePath value, which includes the absolute URL. For this particular URL, CubeCart requires the path to the cornector, but not the http://mysite.com part.

To strip this out, edit /admin/includes/rte/fckconfig.php at around line 287. Look for the line reading "FCKConfig.ImageBrowser = true ;" and

FCKConfig.ImageBrowser = true ; // unchanged line

//FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=uploads&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ; // commented out line

var connectorPath = document.location.pathname.substring( 0, document.location.pathname.lastIndexOf( '/' ) + 1); // new line

FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=uploads&Connector=' + encodeURIComponent( connectorPath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ; // modified line

FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ; // unchanged line

FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7; // 70% ; // unchanged line

This isn't an ideal fix, so hopefully the CubeCart devs can look at this problem and fix the issue within CubeCart itself for the next version. I'm guessing the issue doesn't affect everyone but there are a few people on these forums reporting the same problem.

Anyway, hope this helps someone.

/\dam

Link to comment
Share on other sites

  • 5 weeks later...

  • 7 months later...
  • 2 months later...
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...