Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I enter a relative url TinyMCE converts it to an absolute one.
How can I disable this?
I know that there is a configuration setting for tinyMCE_init called relative_urls=false.
But where do I change this setting?
Comments
Comment #1
sunAre you sure you have the latest development snapshot installed? That should contain and use the configuration option "convert_urls" = FALSE, which means that the editor won't convert any URLs at all.
Comment #2
tomsm CreditAttribution: tomsm commentedYes, the one of 21 April 2009: Wysiwyg API 6.x-2.x-dev (2009-Apr-21)
How can I check this configuration option?
Comment #3
tomsm CreditAttribution: tomsm commentedWhen I enter "/drupal/en/node/123", the URL is changed to "http://localhost/en/node/123" when I save the node.
When I disable the rich text editor, the URL is not changed after saving.
Comment #4
lhugg CreditAttribution: lhugg commentedThere is an option called 'convert_urls'=>FALSE in a file called tinymce.inc that is located in /sites/all/modules/wysiwyg/editors. Haven't tested it, but I assume that's what it does.
Comment #5
tomsm CreditAttribution: tomsm commentedYes, I have found this option:
// TinyMCE's URL conversion magic breaks Drupal modules that use a special
// syntax for paths. This makes 'relative_urls' obsolete.
'convert_urls' => FALSE,
So url conversion should not happen, but is does happen. Is there another setting in Drupal that may cause this?
There also exists an relative_urls, but this is not present in tinymce.inc. Coul this help?
Or the option 'document_base_url' => base_path()? Can this help?
Comment #6
sunI don't know, please let us know if you find out.
Comment #7
sunSorry, I'm unable to replicate this issue in the latest official release.
Feel free to re-open this issue if you want to provide further information. Thanks.
Comment #8
tomsm CreditAttribution: tomsm commentedI have updated all modules and the problem has disappeared. Do not know what caused it.
Thank you for your help!