When creating a alias for a base page containing a "/" as this one content/my-page , the base-url or the basr_path seems to be not correct.
I saw that when adding an image with a relative path to sites/default/files/images/my-image.png
Without the "/" in the alias, the image displays correctly, as it does in the wysiwyg editor. But when adding a "/" in the alias, Drupal adds the base_path in front of the source path of the image and adds the word "content", coming from the alias of the page.
This results in a wrong source path for the image, because the image is not in a subdirectory named "content".
I think base_path function is returning the whole url until the last "/" in the url string... where it should return the installation path (and thus cut the whole page alias, even if it contains a "/")
Thanks for reading, I've found a work-around by replacing all my "/" in aliases by some "-", which is not so beautilful :-/
Comments
Comment #1
juhaniemi commentedCan you provide some more information about your configuration, what WYSIWYG are you using, do you have any special input filters set up, etc?
I cannot reproduce this problem with using only plain Drupal core. Actually it works exactly the opposite, "/" is required to be in front of every image URL, or it will determine relative URL incorrectly when viewing a page that has a slash somewhere between the URL alias (like content/my-page).
Comment #2
dddave commentedNo feedback.