我尝试使用以下网址提供的工具删除主数据库中已损坏的链接。 http://mysite/sitecore/admin/RemoveBrokenLinks.aspx
一段时间后,进程被中断,我在Sitecore日志中收到以下错误。
6220 10:56:26 INFO Removing broken link- Database: master, Item: /sitecore/content/Home/blog/2012/January/13/totaljobs-group-benefit-from-expert-sitecore-consultancy-delivered-by-codehouse, Field: __Renderings, Target item database: master, Target item path: /sitecore/content/global/Codehouse Widgets/Mini Form Widgets/newsletter-subscription
6220 10:56:26 INFO Done
6220 10:56:26 INFO Removing broken link- Database: master, Item: /sitecore/content/Home/blog/2012/January/13/totaljobs-group-benefit-from-expert-sitecore-consultancy-delivered-by-codehouse, Field: __Renderings, Target item database: master, Target item path: /sitecore/content/global/Codehouse Widgets/Mini Form Widgets/sitecore-demo-text-only
6220 10:56:26 INFO Done
6220 10:56:26 ERROR Error looking up template field. Field id: {00000000-0000-0000-0000-000000000000}. Template id: {0437FEE2-44C9-46A6-ABE9-28858D9FEE8C}
Exception: System.ArgumentOutOfRangeException
Message: Null ID is not allowed.
Parameter name: fieldID.
Actual value was {00000000-0000-0000-0000-000000000000}.
Source: Sitecore.Kernel
at Sitecore.Data.Templates.TemplateSection.GetField(ID fieldID)
at Sitecore.Data.Templates.Template.DoGetField(ID fieldID, String fieldName, Stack`1 stack)
at Sitecore.Data.Templates.Template.DoGetField(ID fieldID, String fieldName, Stack`1 stack)
at Sitecore.Data.Templates.Template.DoGetField(ID fieldID, String fieldName, Stack`1 stack)
at Sitecore.Data.Templates.Template.GetField(ID fieldID)
6220 10:56:26 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.ArgumentOutOfRangeException
Message: Null ID is not allowed.
Parameter name: fieldID.
Actual value was {00000000-0000-0000-0000-000000000000}.
Source: Sitecore.Kernel
at Sitecore.Data.Templates.TemplateSection.GetField(ID fieldID)
at Sitecore.Data.Templates.Template.DoGetField(ID fieldID, String fieldName, Stack`1 stack)
at Sitecore.Data.Templates.Template.DoGetField(ID fieldID, String fieldName, Stack`1 stack)
at Sitecore.Data.Templates.Template.DoGetField(ID fieldID, String fieldName, Stack`1 stack)
at Sitecore.Data.Templates.Template.GetField(ID fieldID)
at Sitecore.Data.Fields.Field.GetTemplateField()
at Sitecore.Data.Fields.FieldTypeManager.GetField(Field field, String runtimeValue)
at Sitecore.sitecore.admin.RemoveBrokenLinks.FixBrokenLinksInDatabase(Database database, Boolean serializeItem)
at Sitecore.sitecore.admin.RemoveBrokenLinks.FixBrokenLinksOnClick(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
答案 0 :(得分:0)
在执行RemoveBrokenLinks之前,您是否可以创建清理数据库? Tu清理数据库转到 - >控制面板 - >数据库 - >清理数据库 我想你有一些孤儿项目(没有模板的项目) 当您执行清理数据库时,将执行下一个任务:
删除无效的语言数据。
删除非现有项目的字段。
答案 1 :(得分:0)
通过使用清理数据库或重建链接数据库来解决问题,这很奇怪。
几个问题:
Exception: System.ArgumentOutOfRangeException
的原因。您能否重复相同的重建和清理过程,让我们知道第二轮的结果? 或者,如果您发现重复此过程非常耗时且性能较高,那么您可能需要考虑创建 LinkDatabaseRefreshTool.aspx 文件,将其放在\ Website \ admin文件夹中,并带有以下内容代码作为处理器:
foreach (var specificItem in itemList)
{
specificItem.Editing.BeginEdit();
Sitecore.Globals.LinkDatabase.UpdateReferences(specificItem);
specificItem.Editing.EndEdit();
}
创建一个asp:Textbox和一个调用此方法OnClick的提交按钮。访问http:\\YOUR_WEBSITE\admin\LinkDatabaseRefreshTool.aspx
之前我遇到过同样的问题,我只是重新重建它并解决了这个问题。也许只是你自己的同一个解决方案,值得一试。