Exception when editing links in TinyMCE editor

Vote:
 

Installed a clean EPi Relate+ 2.0 R2-site with SQL-database.
When trying to edit an existing link in the TinyMCE-editor i get the following exception:

[InvalidOperationException: This operation is not supported for a relative URI.]
   System.Uri.get_LocalPath() +6916152
   EPiServer.Templates.RelatePlus.InitializationModules.CmsIntegrationModule.UrlRewriteProvider_ConvertingToInternal(Object sender, UrlRewriteEventArgs e) +34
   EPiServer.Web.UrlRewriteProvider.OnConvertingToInternal(UrlRewriteEventArgs e) +26
   EPiServer.Web.FriendlyUrlRewriteProvider.TryConvertToInternal(UrlBuilder url, LanguageApiMode apiMode, CultureInfo& preferredCulture, Object& internalObject) +173
   EPiServer.Web.FriendlyUrlRewriteProvider.ConvertToInternal(UrlBuilder url, Object& internalObject) +31
   EPiServer.Web.UrlRewriteProvider.ConvertToInternal(UrlBuilder url) +24
   EPiServer.UI.Editor.Tools.Dialogs.HyperlinkProperties.OnLoad(EventArgs e) +440
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

When installing a clean CMS 6 R2-site, this does not occur.
Tried it both on IIS8 with SQL2012 and on IIS7 with SQL 2008.

A link in the editor might look like this:

asd

The url in the popup looks like this:
http://site/secui/CMS/editor/dialogs/HyperlinkProperties.aspx?diablecontentedit=true&url=%2Ftemplates%2Fmain%2Fpages%2Fstandardpage.aspx%3Fid%3D71

Any hints on solving this would be highly appreciated!

#132932
Aug 21, 2015 8:03
Vote:
 

If anyone stumbles onto the same issue...
Epi Support told us to replace the following method (in Templates\RelatePlus\InitializationModules\CmsIntegrationModule.cs):

private void UrlRewriteProvider_ConvertingToInternal(object sender, EPiServer.Web.UrlRewriteEventArgs e)
    {
        if (e.Url.Uri.IsAbsoluteUri && e.Url.Uri.LocalPath.EndsWith(".aspx", StringComparison.InvariantCultureIgnoreCase) && e.Url.QueryCollection.Get("id") != null)
        {
            e.Cancel = true;
        }
    }


..didn't work for us so we created a custom FriendlyUrlRewriteProvider.

public class IntraCustomRewriteProvider : EPiServer.Web.FriendlyUrlRewriteProvider
    {
        public override bool ConvertToInternal(UrlBuilder url, out object internalObject)
        {
            try
            {
                return base.ConvertToInternal(url, out internalObject);
            }
            catch (Exception)
            {
                internalObject = null;
                return false;
            }
        }
    }

Needed to be configured in episerver.config as the default-provider.

<urlRewrite defaultProvider="IntraCustomRewriteProvider">
    <providers>
      <add
        name="IntraCustomRewriteProvider"
        enableSimpleAddress="true"
        friendlyUrlCacheAbsoluteExpiration="0:0:10"
        type="NVV.Intranet.modules.IntraCustomRewriteProvider, NVV.Intranet"
        description="IntraCustomRewriteProvider" />
      
      <add name="EPiServerFriendlyUrlRewriteProvider" type="EPiServer.Web.FriendlyUrlRewriteProvider,EPiServer" />
      <add description="EPiServer identity URL rewriter" name="EPiServerIdentityUrlRewriteProvider" type="EPiServer.Web.IdentityUrlRewriteProvider,EPiServer" />
      <add description="EPiServer bypass URL rewriter" name="EPiServerNullUrlRewriteProvider" type="EPiServer.Web.NullUrlRewriteProvider,EPiServer" />
    </providers>
  </urlRewrite>

Something is probably wrong in our application.
For some reason it tries to convert an alredy relative URL to... a relative URL causing an exception further down the line.
However catching the exception here solves it. And it's probably not the correct way of fixing this but after a week of trying in other manners - doesn't matter!

#133219
Edited, Aug 27, 2015 15:45
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.