Since RC4 I noticed that checking "Replace relative paths with absolute URLs" stopped working, that is, it does nothing.

After a bit of digging I found a workaround, in case someone else needs it for now, just replace your

img src="/files/img.png"...

with

img src=" /files/img.png"...

That is, by adding a space between the " and the / we trick the regexp into working. Thus the url gets converted to http://website.org/files/img.png

Comments

jmvidal’s picture

Issue summary: View changes
jmvidal’s picture

Issue summary: View changes
mauricio.tollin’s picture

StatusFileSize
new645 bytes

I fixed it changing the pattern used to replace the urls, in views_rss.module > function views_rss_rewrite_relative_paths
$pattern = '/(src|href)=(\'|")' . preg_quote($base_path, '/') . '/';

It works on simple relative paths, like src="/. But not works in paths with space.
And I not tested other cases.

Patch attached.

colling2’s picture

Looks like it was the fix for issue 1960216 that broke this.

TGEink’s picture

I tried this patch, but still not working. Our URLs from this module come out:

http://thegreeneconomy.com/%3Ca%20href%3D%22http%3A//thegreeneconomy.com...

Instead of
http://thegreeneconomy.com/content/defining-economics-and-secular-stagna...

It's a serious problem. Is there ANY way to fix this?

lily.yan’s picture

#3 worked for me. thanks a lot.

nuncium’s picture

With me, #3 method doesn't work that well.
On multilingual website it creates
www.mywebsite.com/enen/ instead of
www.mywebsite.com/en/

Any hints why?
Thanks!

liam morland’s picture

Status: Active » Needs review
liam morland’s picture

Version: 7.x-2.0-rc4 » 7.x-2.x-dev
marucci’s picture

StatusFileSize
new1.61 KB

Based on this solution, I created a module for those cannot edit their module

damienmckenna’s picture

Issue tags: +Needs tests

I think we need to add some minimal test coverage to make sure it works the way we expect.