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

juhaniemi’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Can 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).

dddave’s picture

Title: Page Paht alias with a "/" corrupts base_path function » Page Path alias with a "/" corrupts base_path function
Status: Postponed (maintainer needs more info) » Closed (won't fix)

No feedback.