I have been having an issue when I create links to other pages on my site using tinymce. If I enter the full url in and save the node (or just turn off tinymce) it makes the link relative so that "http://www.example.com/node/411" becomes "node/411".
So that if the node shows up on a taxonomy list at "http://www.example.com/taxonomy/term/1" the link refers to "http://www.example.com/taxonomy/term/1/node/411", which of course doesn't work.
I fixed the problem by changing line 490 in tinymce.module to:
$init['document_base_url'] = "base_path()";
Originally it looks like:
$init['document_base_url'] = "$host";
But I have no idea why this works because the $host and base_path() should be exactly the same - line 479 in tinymce.module looks like this "$host = base_path();"
Has anyone else had this issue?
Comments
Comment #1
Visigotik commentedYes, I have the same problem.
Comment #2
quaestor commentedYou may wish to look at 23182. It seems that TinyMCE is set to do this by default. I didn't change my theme but rather I edited the tiny_mce.js file to turn off relative URLs. But editing your theme is probably the smarter thing to do. Editing the js file feels more like a hack.
Comment #3
m3avrck commentedThis was recently fixed in CVS. By default now, all URLs are relative the root. The reason your change worked was because base_path() was not evaluated in quotes like so hence it was ''.