Custom MediaLinkPrefix causes errors when creating a message in the Email Campaign Manager


Description

When the Media.MediaLinkPrefix setting is set to a custom value such as "-/media", the following errors may appear in Email Campaign Manager UI when creating a new email message:

Illegal characters in path.
'/sitecore/shell/themes/standard/-/media/4BD924C0313848588F8E5608A1115304.ashx?...' is not a valid virtual path.
The issue affects EXM 2.0-2.1 versions.

Solution

To address the issue, set the Media.MediaLinkPrefix setting to default value.

You may also add previously used custom media link prefix as an additional media prefix. This way all the bookmarked by users URLs that previously used the custom prefix will continue working.

Below is the list of recommended configuration changes:

  1. Set the "Media.MediaLinkPrefix" setting to the default value (""):
    <setting name="Media.MediaLinkPrefix" value=""/>
  2. Make sure that the "~/media/" prefix exists in the "CustomHandlers" section:
    <customHandlers>
       <handler trigger="~/media/" handler="sitecore_media.ashx"/>
       <handler trigger="~/api/" handler="sitecore_api.ashx"/>
       ...
    </customHandlers>
  3. Add the old custom media link prefix (for example "-/media") to the "mediaPrefixes" section:
    <mediaPrefixes>        
       <prefix value="-/media"/>        
    </mediaPrefixes>