Sitecore:启用页面编辑器时参数超出范围

Sitecore: argument out of range when page editor is enabled

目前唯一的目标是 运行 Sitecore 页面编辑器没有问题。错误来自以下 URL:

http://localhost/sitecore/shell/Applications/WebEdit/WebEditRibbon.aspx?db=master&id={guid}&la=en&vs=1&url=%2F&mode=edit&sc_pagesite=website&trf=%2Ftemp%2Fdiagnostics%2Ftrace_{guid}.xml&prf=%2Ftemp%2Fdiagnostics%2Fprofile_{guid}.xml&dev={guid}

当我在启用页面编辑器的情况下打开任何页面时出现此异常:

16028 13:57:46 ERROR Application error.
Exception: System.Web.HttpUnhandledException
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.sitecore_shell_applications_webedit_webeditribbon_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\rootd565cb3f479ba\App_Web_pyaedh12.0.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Nested Exception

Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.CallMethod(Type type, Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Boolean includeStatic, Object[] parameters)
   at Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Nested Exception

Exception: System.ArgumentOutOfRangeException
Message: startIndex cannot be larger than length of string.
Parameter name: startIndex
Source: mscorlib
   at System.String.Substring(Int32 startIndex, Int32 length)
   at Sitecore.Links.LinkProvider.LinkBuilder.GetItemPathElement(Item item, SiteInfo site)
   at Sitecore.Links.LinkProvider.LinkBuilder.BuildItemUrl(Item item)
   at Sitecore.Links.LinkProvider.GetItemUrl(Item item, UrlOptions options)
   at Sitecore.Providers.LinkProvider.GetItemUrl(Item item, UrlOptions options)
   at Sitecore.Web.WebEditUtil.GetItemUrl(Item item)
   at Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.RenderTreecrumbGo(HtmlTextWriter output, Item item)
   at Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.RenderTreecrumb(Item item)
   at Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.OnLoad(EventArgs e)

禁用页面编辑器时页面呈现正常。

运行 版本:

我已尝试删除 layouts/renderings 中与 Sitecore 相关的所有内容,但该错误仍然出现。我意识到如果不查看配置文件就无法弄清楚发生了什么,但希望有人之前偶然发现了这个错误!

谢谢!

问题出在 rootPath 属性上。看来不能比/sitecore/content低两级了。当我将它从 /sitecore/content/foo/bar 更改为 /sitecore/content/foo 时,它再次起作用。希望 Sitecore 资深人士可以解释这是为什么!