Closed (duplicate)
Project:
SunMailer Newsletter
Version:
6.x-1.7
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jan 2012 at 16:46 UTC
Updated:
5 Mar 2012 at 11:04 UTC
I finally gave up using Sunmaler 2, hoping that the 6.x-1 branch is more mature
Yet I am hit by the same issue than in 6.x-2
http://drupal.org/node/1367526
I changed in sunmailer.xml.inc around line 110
$value = preg_replace('|href="/|', "href=\"$base_root/", $value); // Make all URLs absolute.
by
$value = preg_replace('#(src|href)=(["\'])/#', "$1=$2$base_root/", $value); // Make all URLs absolute.
This made CCK fields working fine, showing images properly.
However, images in node body (edited with CKeditor) are still broken, the links stay relatve.
I tried Pathologic, but it did not help.
Thanks for help.
Comments
Comment #1
jvieille commentedBellow an example of the xml generateed.
Images in teaser are not made absolute, while the File Framework CCK field is OK
By the way, I do not understand why the teaser link contents "/sites/see.shareontheweb.com/files/" while the cck field gives a much shorter link - both working.
For example
Image in body link
http://web2.see.asso.fr/sites/see.shareontheweb.com/files/editorimages/E...
Image in FF CCK field
http://web2.see.asso.fr/bitcache/ec338239f51a870c69ea61895698eaade458e7f...
Both /bitcahce and /editorimages are under the /file directory of the site (multiinstall)
This link does not work:
http://web2.see.asso.fr/sites/editorimages/ERTS2012.jpg
Anyway, the code fix worked well with the 6.x-2 version but not completely with 6.x-1
I also tried this code
$value = preg_replace('#(src|href)=(["\'])/#', "$1=$2$base_url/", $value);replacing $base_root by $base_url
same result
Comment #2
jvieille commentedI found the problem.
The place I put the code was only intended to correct links in filelds. Actually, it the function sunmailer_get_section_nodes() was never called in any situation during my tests.
I changed the function
to
May be some further clean up is needed as apparently some functions are not in use (at least sunmailer_get_section_nodes).
Thanks for updating the module.
Comment #3
Mike Wacker commentedRe-opening #1367526: Relative paths are not converted in messages to port the patch downstream to 6.x-1.x-dev.