2012-03-01, 22:22:45
(This post was last modified: 2012-03-01, 22:24:37 by film letöltés.)
Hello,
I think I've cracked this small but important issue with image paths being relative from within CKEDITOR.
The key to this issue was confirmed to me in LogicalOctopus statement.
When you select an image after clicking the "Browse Server" button the full URL path was transferred into the image dialog box. CKEDITOR just used whatever was in the box and placed it in the source code.
The solution that I found but may need to be tested by others for confirmation.
Change line 24 of filebrowser.php from
$fullPath = $sitepath . "data/uploads/";
to
$fullPath = "data/uploads/";
I know line 23 was mentioned but changing line 24 so the $sitepath was omitted completly seemed to work great.
No other changes need to be done to GS. Leave all config files as they are in repsect to baseurl etc.
This solution is not "Upgrade friendly" but it seems to work in both Admin and Frontends of LOCALHOST and Live Domains (and I imagine if GS was installed into a subfolder).
I don't know if there could be a more permanent solution or if there is another reason why $sitepath was added to this line in filebrowser.php. All my testing seems to indicate that having a relavtive path is better than hardcoding the full site's URL in the source code.
I noticed that 3.1 also has this line in filebrowser.php (line 26)
On a sidenote using CKEDITOR with CKFINDER places a relative URL in the Source code which works both in LOCALHOST and the live domain.
Let me know if this works on other peoples environments.
I think moving GS websites around from local PC's, demo locations and Live Domains etc is fairly common and just being able to ZIP up the whole thing an locate it elsewhere fully in-tact without doing a massive Find and Repalce for every image or PDF link could be very handy.
I think I've cracked this small but important issue with image paths being relative from within CKEDITOR.
The key to this issue was confirmed to me in LogicalOctopus statement.
Quote:The actual problem isn't with CKEditor but with the image browser which resolves the image path separately.
When you select an image after clicking the "Browse Server" button the full URL path was transferred into the image dialog box. CKEDITOR just used whatever was in the box and placed it in the source code.
The solution that I found but may need to be tested by others for confirmation.
Change line 24 of filebrowser.php from
$fullPath = $sitepath . "data/uploads/";
to
$fullPath = "data/uploads/";
I know line 23 was mentioned but changing line 24 so the $sitepath was omitted completly seemed to work great.
No other changes need to be done to GS. Leave all config files as they are in repsect to baseurl etc.
This solution is not "Upgrade friendly" but it seems to work in both Admin and Frontends of LOCALHOST and Live Domains (and I imagine if GS was installed into a subfolder).
I don't know if there could be a more permanent solution or if there is another reason why $sitepath was added to this line in filebrowser.php. All my testing seems to indicate that having a relavtive path is better than hardcoding the full site's URL in the source code.
I noticed that 3.1 also has this line in filebrowser.php (line 26)
On a sidenote using CKEDITOR with CKFINDER places a relative URL in the Source code which works both in LOCALHOST and the live domain.
Let me know if this works on other peoples environments.
I think moving GS websites around from local PC's, demo locations and Live Domains etc is fairly common and just being able to ZIP up the whole thing an locate it elsewhere fully in-tact without doing a massive Find and Repalce for every image or PDF link could be very handy.