Possible bug: Insert/edit link in RTE on a site with multiple sites
Consider an installation with the following websites:
Corporate site Hostname: www.corpsite.com
Brans site Hostname: brand.corpsite.com
When I am logged into www.corpsite.com/umbraco and edit the page SomeBrandPage on Brand site and create a link to the SomeCorpPage in the Corp Site with the url http://www.corpsite.com/somecorppage.aspx the RTE consistently removes the domain prefix and saves <a href="/somecorppage.aspx">...</a>. It makes no difference if I use the node picker in the Insert/edit link dialog, insert the complete url directly in the url text field or if I edit the HTML of the Rich Text Area. It strips the domain prefix when I save :-(
When I see the Properties tab on the SomeBrandPage I am editing on the Brand Site while logged in to www.corpsite.com/umbraco I can see two links to the page. The Link to document is /somecorppage.aspx and the Alternative Links is displaying http://www.corpsite.com/somecorpsite.aspx. The first link will never work as long as I am logged in to www.corpsite.com/umbraco and am browsing the Brand site in umbraco. The other link, the complete link, will work, and I would expect this to be the link saved in the Rich Text Editor when inserting a link on the Brand site linking to a page on the Corp site.
- - Can anyone confirm this behavior or help me to figure out what is causing this?
This should make sure that when you use the node picker an get a link like {localLink:1234} it should render the link with the correct domain name in front of it.
Also Morten, even if I in the Insert/edit link dialog type the full url, eg. http://www.corpsite.com/somecorppage.aspx, it still changes the url to just /somecorppage.aspx.
I have been doing some more testing. Even when just picking a node from the Node Tree the Insert/edit link dialog, and confirming that the url is inserted as {locallink:xxxx} the link is not rendered with domain name.
There is definitely some strange behavior when parsing the links inserted in the RTE when having an umbraco installation running multiple sites with different domains.
I am encountering this problem too. I'm thinking one temporary workaround would be to use Javascript to set the document location, but I haven't tried that yet. Was this ever reported on CodePlex? All I could find was the following two issues, which seem to be similar: http://umbraco.codeplex.com/workitem/19818 and http://umbraco.codeplex.com/workitem/25975 . Are there any other known workarounds?
Umbraco is "smart" enough to butcher the URL even in the onclick event if you don't concatenate multiple strings. I'm sure one could also create a JavaScript function that contains the URL and call that instead of using the inline JavaSript with the concatenated strings.
Anybody got the fix for this yet? Looks like a tinyMCE issue ( http://drupal.org/node/145966 ) but still can't figure out the solution.
Same issue, different CMS. Both use TinyMCE. I've done what they suggest but no go. I've tried to 'push' the web.config file, log-out/in of umbraco, even went to the point of restarting IIS just to try and get this to go.
If someone else wants to give it a try and see if anyone has success, let me know.
Yes, there is a solution to this in Umbraco (not sure about Drupal). In the "config" folder, there is a file called "tinyMceConfig.config". Look for the "convert_urls" key and change the value to "false". If you do not have that key present, place it under tinymceConfig/customConfig. Something like this (the rest of the contents of the file have been removed):
When the protocol is excluded, the protocol of the current page (e.g., HTTP, HTTPS, or FILE) is used. I have confirmed that this works. However, if you need to specify a protocol, then it would not work.
I believe this is an Umbraco issue and not a tinyMce issue, as the URL only gets changed when the content node is saved. Also, I inspected the property using the Chrome debugger, and it appears Umbraco is calling tinyMCE.init incorrectly. For one, it is passing "relative_urls" with a value of "'false,false'" and "remove_script_host" with a value of "'true,false'" (it is surrounding that pair of bools with apostrophes, and so they would be treated as strings). It does, however, pass "convert_urls" as "false" (it passes that as a bool rather than string).
Even though Umbraco is initializing tinyMCE incorrectly, I suspect Umbraco also has some server-side code that is botching URL's.
Note that I'm using Umbraco 4.7.1 (assembly version 1.0.4281.20201).
And one more recommendation. I think Umbraco might only botch URL's for the current domain. So if you setup a second domain so that you can access Umbraco via that domain, then maybe Umbraco wouldn't botch the URL. So suppose you are on site.com. You could point site2.com to the same website and use site2.com/umbraco/ to do any edits. I haven't tried it, but that may prevent Umbraco from screwing up the URL's.
Possible bug: Insert/edit link in RTE on a site with multiple sites
Consider an installation with the following websites:
Corporate site
Hostname: www.corpsite.com
Brans site
Hostname: brand.corpsite.com
When I am logged into www.corpsite.com/umbraco and edit the page SomeBrandPage on Brand site and create a link to the SomeCorpPage in the Corp Site with the url http://www.corpsite.com/somecorppage.aspx the RTE consistently removes the domain prefix and saves <a href="/somecorppage.aspx">...</a>. It makes no difference if I use the node picker in the Insert/edit link dialog, insert the complete url directly in the url text field or if I edit the HTML of the Rich Text Area. It strips the domain prefix when I save :-(
When I see the Properties tab on the SomeBrandPage I am editing on the Brand Site while logged in to www.corpsite.com/umbraco I can see two links to the page. The Link to document is /somecorppage.aspx and the Alternative Links is displaying http://www.corpsite.com/somecorpsite.aspx. The first link will never work as long as I am logged in to www.corpsite.com/umbraco and am browsing the Brand site in umbraco. The other link, the complete link, will work, and I would expect this to be the link saved in the Rich Text Editor when inserting a link on the Brand site linking to a page on the Corp site.
- - Can anyone confirm this behavior or help me to figure out what is causing this?
Kind regards
Dennis Milandt
in the umbracoSettings.config there is an option:
This should make sure that when you use the node picker an get a link like {localLink:1234} it should render the link with the correct domain name in front of it.
Yup - useDomainPrefixes are set to true for the site. Was the first thing I checked :-)
Kind regards
Dennis Milandt
Also Morten, even if I in the Insert/edit link dialog type the full url, eg. http://www.corpsite.com/somecorppage.aspx, it still changes the url to just /somecorppage.aspx.
Kind regards
Dennis Milandt
I have been doing some more testing. Even when just picking a node from the Node Tree the Insert/edit link dialog, and confirming that the url is inserted as {locallink:xxxx} the link is not rendered with domain name.
There is definitely some strange behavior when parsing the links inserted in the RTE when having an umbraco installation running multiple sites with different domains.
Kind regards
Dennis Milandt
Sounds like it might be a bug.
If you can reproduce on a clean install, then write down the steps to do so, and file it on codeplex.
I am encountering this problem too. I'm thinking one temporary workaround would be to use Javascript to set the document location, but I haven't tried that yet. Was this ever reported on CodePlex? All I could find was the following two issues, which seem to be similar: http://umbraco.codeplex.com/workitem/19818 and http://umbraco.codeplex.com/workitem/25975 . Are there any other known workarounds?
This is the workaround I went with (using the OP's example):
Umbraco is "smart" enough to butcher the URL even in the onclick event if you don't concatenate multiple strings. I'm sure one could also create a JavaScript function that contains the URL and call that instead of using the inline JavaSript with the concatenated strings.
Anybody got the fix for this yet? Looks like a tinyMCE issue ( http://drupal.org/node/145966 ) but still can't figure out the solution.
Same issue, different CMS. Both use TinyMCE. I've done what they suggest but no go. I've tried to 'push' the web.config file, log-out/in of umbraco, even went to the point of restarting IIS just to try and get this to go.
If someone else wants to give it a try and see if anyone has success, let me know.
http://www.tinymce.com/wiki.php/TinyMCE_FAQ#Paths.2FURLs_are_incorrect.2C_I_want_absolute.2Frelative_URLs.3F
Byron,
Yes, there is a solution to this in Umbraco (not sure about Drupal). In the "config" folder, there is a file called "tinyMceConfig.config". Look for the "convert_urls" key and change the value to "false". If you do not have that key present, place it under tinymceConfig/customConfig. Something like this (the rest of the contents of the file have been removed):
Maybe Drupal has a similar configuration file. Or maybe they use the JSON configuration option. You can read more about the convert_urls setting here: http://www.tinymce.com/wiki.php/Configuration:convert_urls
Nicholas, since no one in this post talked about TinyMCE yet I was using the Drupal link as reference for TinyMCE.
I am using Umbraco and tried you suggestion, didn't work. Do I have to 'push' something, recycle/restart something for this change to take effect?
Thanks again, this has been a huge time vampire in trying to fix-it and work around it.
I found one annoying workaround. First, modify tinyMceConfig.config to ensure it has these elements:
Then modify your web.config and save it so a recompile is forced. Next, modify any URL's so they exclude "http". For example:
When the protocol is excluded, the protocol of the current page (e.g., HTTP, HTTPS, or FILE) is used. I have confirmed that this works. However, if you need to specify a protocol, then it would not work.
To ensure this bug gets some attention, I recommend you vote on it here: http://umbraco.codeplex.com/workitem/30149
I believe this is an Umbraco issue and not a tinyMce issue, as the URL only gets changed when the content node is saved. Also, I inspected the property using the Chrome debugger, and it appears Umbraco is calling tinyMCE.init incorrectly. For one, it is passing "relative_urls" with a value of "'false,false'" and "remove_script_host" with a value of "'true,false'" (it is surrounding that pair of bools with apostrophes, and so they would be treated as strings). It does, however, pass "convert_urls" as "false" (it passes that as a bool rather than string).
Even though Umbraco is initializing tinyMCE incorrectly, I suspect Umbraco also has some server-side code that is botching URL's.
Note that I'm using Umbraco 4.7.1 (assembly version 1.0.4281.20201).
And one more recommendation. I think Umbraco might only botch URL's for the current domain. So if you setup a second domain so that you can access Umbraco via that domain, then maybe Umbraco wouldn't botch the URL. So suppose you are on site.com. You could point site2.com to the same website and use site2.com/umbraco/ to do any edits. I haven't tried it, but that may prevent Umbraco from screwing up the URL's.
Thanks, this works. I appreciate all your info and insight.
is working on a reply...