Link via Upload Has Double Slash

I’ve run into a small but significant issue when uploading a file or image: The resulting src for the image/file inserted begins with two slashes instead of one. This occurs when

  • The specified media source is a custom one
  • Links are set up to be root relative

Note that the upload of the image/file is successful and gets saved to the correct directory as specified in the config. Also, when choosing an already-existing image/file, the resulting src is correct (prefixed with only a single slash).

Thanks for looking into this when you can!

Hey Jim,

Can you please show your media source + upload path configuration?

I’m guessing the double path is a result of that; perhaps you have baseUrlRelative enabled and start the baseUrl with a slash too?

Also, what version of Redactor?

Hi Mark,

First off, I hope you are doing well and keeping busy. I appreciate the quick reply!

Taking your hint from above, I double-checked the output of my baseUrl and found that disabling the baseUrlRelative setting fixed the issue. It wasn’t immediately obvious, as I use a snippet to return the value of MODX_ASSETS_URL at the beginning of my basePath and baseUrl values. The motivation behind that is the fact that I have a custom-named assets directory along with a multi-context setup. Bottom line: Developer oversight on my part.

For the record I’m running Redactor 3 on MODX 2.7.3 for this particular install.

Thanks for pointing me in the right direction!

1 Like

Glad you figured it out :slight_smile: