Hello, the Pathologic module needs true relative paths to work properly (without first slash and without http://, ...) but this module returns the path relative to server with first slash (and sub directory if drupal is installed as it).

So here is a small patch to add an option to common settings of IMCE, this option is called 'True relative URLs' and it's enabled by default.

This allows IMCE to return the correct URL for the Pathologic module.

Sorry for my bad english

Comments

Leeteq’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
Category: task » feature
singularo’s picture

I like this idea, but I tried the patches, and the preview stopped working etc with the imce+wysiwyg+imce_wysiwyg combo, so I can't use it.
Just FYI

sinasquax’s picture

I use the same combo and it works, the patches doesn't alters the preview normally, did you test on the 6.x-1.2 version ?

I don't know why #1 has changed the number of version ?!

ufku’s picture

Status: Needs review » Closed (won't fix)

Pathologic exists in order to fix broken URLs.
This patch breaks IMCE URLs in order to make Pathologic fix them again. Really strange!

lejonsson’s picture

Since ukfu insist on not adopting this feature which many of us requests for good reasons, will anyone maintain this patch? Does it still work on 6.x-1.3?

Anonymous’s picture

Hi,
After googled about one day about this horrible relative path problem, and still not understand why ufku - your work for imce is just great anyway - doesn't want to work with relative path.
I am website builder since about 10 years and I still never use absolute internal links, *only* one big reason : portability !!! It is not normal that changing host will break all of your internal links (images, links, etc). It is not normal to store so much redondant and so much *hardcoded* data.
So now, I think I red most of all posts about this prob, the thing that is inconvenient is only when using RSS feeds or any outter contents that need - of course - absolute urls...ok so there is pathologic module that can rewrite relative urls, only for rss feed for example, that is why this patch is realy cool and not bizarre at all. There is no problem with clean urls or multisite because the html base tag precisely resolves it.
So to summarize, for getting REAL relative path for pictures & else :
1) add a base tag in your templates like :
<base href="http://www.mysite.com/" />
of course with trailing slash...
2) apply this great patch
this insert relative path instead server-relative path, this works in front side but not in preview edition with ckeditor so :
3) add one ckeditor parameter in the file %path_to_modules%/ckeditor/ckeditor.config.js :
config.baseHref = Drupal.settings.basePath;// this will set the absolute path to drupal directory like "/path/to/drupal/"
this is for adding a base tag in the ckeditor preview iframe

ah ok now I can work with the great module IMCE without fear of horribles broken links when moving one site

Anonymous’s picture

subscribing for relative paths