由于空引用异常,Sitecore 的 "Links" 按钮不起作用

Sitecore's "Links" button doesn't work because of a null-reference exception

我正在尝试查看某个项目的链接项目。我正在客户的内容管理服务器上执行此操作。当我点击 Navigate -> Links 时,没有任何反应。我在 JavaScript 控制台中收到此错误:

http://sitename.local/sitecore/shell/default.aspx?xmlcontrol=Gallery.Links&…de-DE&vs=1&db=master&sc_content=master&ShowEditor=1&Ribbon.RenderTabs=true

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

这是我在 Sitecore 日志中看到的内容:

38424 19:09:30 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 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.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
   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.ArgumentNullException
Message: Value cannot be null.
Parameter name: ownerItem
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
   at Sitecore.Data.Fields.Field..ctor(ID fieldID, Item ownerItem)
   at Sitecore.Shell.Applications.ContentManager.Galleries.Links.GalleryLinksForm.GetLinkTooltip(Item reference, ItemLink link)
   at Sitecore.Shell.Applications.ContentManager.Galleries.Links.GalleryLinksForm.RenderReferences(StringBuilder result, List`1 references)
   at Sitecore.Shell.Applications.ContentManager.Galleries.Links.GalleryLinksForm.OnLoad(EventArgs e)

创建项目字段时,ownerItem参数似乎为空。

这种情况发生在几个不同的项目上——例如模板和子布局。

是什么导致了这个问题,我该如何解决?

此问题已在 Sitecore 中注册为错误,并在 Sitecore 8.1 更新 2 中作为从 7.2 更新 6 合并的修复的一部分得到修复: "Includes all relevant fixes from Sitecore 7.2 update-6"

https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Platform/Sitecore%2081/Sitecore%20Experience%20Platform%2081%20Update2/Release%20Notes

“452241:如果存在跨数据库链接,Links 对话框将失败” https://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%207/ReleaseNotes/ChangeLog.aspx

要解决 Sitecore 8.1 更新 1 中的问题,请安装以下补丁:

  1. 将附加的 Sitecore.Support.452241.dll 文件放入您的解决方案的 bin 文件夹中。
  2. 替换 Website\sitecore\shell\Applications\Content Manager\Galleries\Links\Gallery Links.xml 对话框中的以下字符串:
     <CodeBeside Type="Sitecore.Shell.Applications.ContentManager.Galleries.Links.GalleryLinksForm,Sitecore.Client"/>

有了新的:

     <CodeBeside Type="Sitecore.Support.Shell.Applications.ContentManager.Galleries.Links.GalleryLinksForm,Sitecore.Support.452241"/>

Link 您可以在此处找到该文件:https://www.dropbox.com/s/l36zqhwjtahl4q2/Sitecore.Support.452241.dll?dl=0