When uploading images into the editor, it applies the url back to the image by splicing the base url to the files url. Example: "/basedir/sites/default/files" Everything works fine UNTIL you need to move the site to a new location. Let's say you are developing on a staging site in a subdirectory of localhost: "http://localhost/basedir" Now you want to migrate to a domain where the base dir is the root of the domain. "http://www.anysite.com/"

The problem is, fckeditor has embedded the basedir on every image link, so all links will now be broken on the new site. (links will include "basedir" in the URL even though the new site has no basedir: "/basedir/sites/default/files")

I've tried setting up the fckeditor file upload profile to only use relative urls, ("sites/default/files") or even generic urls, ("../sites/default/files") But in either case, fckeditor becomes incapable of finding the file while in the editor, so the images are not viewable while editing. (even though "../sites/default/files" will render correctly in the Drupal page) I've also tried setting the basedir in settings.php, but that didn't work.

Also, when setting up the absolute file path in the fck profile, the documentation states that "if left blank, fck will try to determine the proper path." Unfortunately, if you leave the absolute path blank, you get an error message: "absolute file path is required."

How can one get a relative image path to function properly in FCKeditor??

Comments

vm’s picture

Category: bug » feature
Status: Active » Closed (duplicate)