【问题标题】:Sitecore: Value cannot be null. Parameter name: uriSitecore:值不能为空。参数名称:uri
【发布时间】:2017-06-12 22:34:38
【问题描述】:
Exception: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: uri
Source: Sitecore.Kernel

我正在本地编辑一个占位符项目 我收到此错误时的 Sitecore 8.1 (rev. 151207) 实例。现在我无法编辑、删除或重置它(或其父文件夹)。我也无法在内容编辑器中读取该项目,因为当我单击父文件夹时会弹出错误。我已经尝试从内容编辑器、代码和 PowerShell 命令删除/编辑它,它是父文件夹,但始终显示相同的错误。

我还尝试用我的备份副本替换我的配置和 bin 文件夹、清除缓存、重新启动 IIS 和应用程序池,但没有任何帮助。

我完全被困住了。有谁知道如何解决这个问题?

编辑: 日志中的完整错误是:

Exception: System.ArgumentNullException
Message: Value cannot be null.
Parameter name: uri
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName)
   at Sitecore.Data.ItemUri..ctor(ItemUri uri)
   at Sitecore.Data.Items.Item.GetItemUriFromSourceItem()
   at Sitecore.Data.Items.Item.get_SourceUri()
   at Sitecore.Data.Items.Item.get_Source()
   at Sitecore.Data.Fields.Field.GetSourceItem()
   at Sitecore.Data.Fields.Field.GetInheritedValue(Boolean allowStandardValue)
   at Sitecore.Pipelines.GetFieldValue.GetInheritedValue.Process(GetFieldValueArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Data.Fields.Field.GetValue(Boolean allowStandardValue, Boolean allowDefaultValue, Boolean allowFallbackValue, Boolean allowInheritValue, Boolean allowInnerValue)
   at Sitecore.Pipelines.ItemProvider.GetItem.GetLanguageFallbackItem.IsItemFallbackEnabled(Item item)
   at Sitecore.Pipelines.ItemProvider.GetItem.GetLanguageFallbackItem.Process(GetItemArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
   at Sitecore.Data.Managers.ItemManager.GetItem(ID itemId, Language language, Version version, Database database, SecurityCheck securityCheck)
   at Sitecore.Nexus.Data.DataCommands.GetChildrenCommand.Execute(Item )
   at Sitecore.Data.Engines.EngineCommand`2.Execute()
   at Sitecore.Data.Managers.ItemProvider.GetChildren(Item item, ChildListOptions options)
   at Sitecore.Data.Managers.ItemProvider.GetChildren(Item item, SecurityCheck securityCheck, ChildListOptions options)
   at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
   at Sitecore.Data.Managers.PipelineBasedItemProvider.GetChildren(Item item, SecurityCheck securityCheck)
   at Sitecore.Collections.ChildList.Populate(ChildListOptions options)
   at Sitecore.Shell.Framework.Pipelines.DeleteItems.GetItemClones(Item item, Boolean processChildren)
   at Sitecore.Shell.Framework.Pipelines.DeleteItems.GetItemClones(Item item, Boolean processChildren)
   at Sitecore.Shell.Framework.Pipelines.DeleteItems.GetItemClones(List`1 items)
   at Sitecore.Shell.Framework.Pipelines.DeleteItems.GetCheckCloneLinksMessage(List`1 items)
   at Sitecore.Shell.Framework.Pipelines.DeleteItems.CheckCloneLinks(ClientPipelineArgs args)

【问题讨论】:

  • 恭喜你提出第 1400 万个堆栈溢出问题 :)
  • 日志中有更详细的错误吗?
  • 占位符项目,你的意思是在演示细节上?您可以尝试将原始值设置为 checked 并查看是否可以更新该项目?
  • 不,它是一个实际的占位符项目。它很臭,因为现在使用该占位符的每个页面也都损坏了。

标签: sitecore uri sitecore8


【解决方案1】:

您提供的异常发生是因为您在项目的 __Source Item - {19B597D3-2EDD-4AE2-AEFE-4A94C7F10E31} 字段中有非空无效值。 __Source Item 负责存储克隆项目的原始项目 URI。

我不知道您是如何做到这一点的,因为saveItem 管道中有一个处理器ValidateCloneSourceModifications 可以防止保存带有无效__Source Item 字段的项目。

我能够通过更改数据库中的字段值来重现您的异常。

如何解决:

  1. 在主数据库 -> SharedFields 表中找到损坏的字段。 FieldId'19B597D3-2EDD-4AE2-AEFE-4A94C7F10E31'
  2. 修复它。它应该类似于sitecore://master/{AE76A034-9491-4B83-99F5-39F227D6FB59},其中 ID 是原始项目 ID。您也可以将 '' 设置为一个值,但它会删除与原始项目的绑定。
  3. 清除缓存。

一定有帮助。

【讨论】:

  • 谢谢谢谢谢谢!我想我也许可以在数据库中编辑它,但找不到合适的表。我能够对其进行编辑并解决问题。
【解决方案2】:

您可以尝试使用 DB Browser /sitecore/admin/dbbrowser.aspx 使用此工具,您也可以删除项目。

如果这个 DB Browser 管理工具失败了,那么我很好奇 master 数据库中有什么,直接在 sql 中检查这个项目的特殊之处,而不是一个选项。

【讨论】:

  • 感谢您的回复!我在 dbbrowser 中遇到了同样的错误,但我可以比在内容编辑器中更进一步……这是主数据库。在网络数据库中很好。我能看到的唯一区别是master的“_Source Item”和“_Source”字段中没有任何内容,而web的具体是“
  • 如果它不包含 null,则它包含空字符串或空格。对于空字符串,您不会收到异常,因为 Sitecore 内部检查,因此您在“__Source Item”字段中有空格,这是一个无效值。看我的回答。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多