• Illegal Characters in Path Exception in Sitecore Preview

    Posted 09/14/2011 by techphoria414

    Just filed a bug report with Sitecore Support. In case you are out there searching Google for the same exception, here's the issue. This is Sitecore 6.4.1 rev. 110720.

    One of my developers accidentally applied Layout Details to a template, instead of its Standard Values. This used to work, even though it is not a best practice. When opening items based on the template, most of the time he would get the error below. This seems to be due to WebEditRibbon.ConvertToJson not finding the Layout Details on the template, then calling the wrong method on XmlDocument (Load instead of LoadXml).
    [ArgumentException: Illegal characters in path.]
       System.IO.Path.CheckInvalidPathChars(String path) +142
       System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) +100
       System.IO.Path.GetFullPath(String path) +187
       System.Xml.XmlResolver.ResolveUri(Uri baseUri, String relativeUri) +131
       System.Xml.XmlTextReaderImpl..ctor(String url, XmlNameTable nt) +135
       System.Xml.XmlDocument.Load(String filename) +85
       Sitecore.Web.UI.WebControls.WebEditRibbon.ConvertToJson(String layout) +210
       Sitecore.Web.UI.WebControls.WebEditRibbon.Render(HtmlTextWriter output, Item item) +1268
       Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +387
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +315
       System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +48
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246
       System.Web.UI.Page.Render(HtmlTextWriter writer) +40
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
       Boolean includeStagesAfterAsyncPoint) +5290
    The solution is simply to apply the layout details to the Standard Values, instead of the Template itself.

    Read more... Pre-Disqus Comments (3)