gpt4 book ai didi

sitecore - 页面预览期间的功能区控件异常

转载 作者:行者123 更新时间:2023-12-04 16:53:23 28 4
gpt4 key购买 nike

嗨,在预览期间加载页面时我没有加载功能区。
你有任何线索如何解决它吗?

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
Sitecore.Data.Database.ApplySecurity(Item[] items) +112
Sitecore.Data.Database.SelectItems(String query) +252
Sitecore.Shell.Applications.WebEdit.Commands.OpenMyItems.GetHeader(CommandContext context, String header) +188
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderSmallButton(HtmlTextWriter output, Item button, CommandContext commandContext) +307
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderButton(HtmlTextWriter output, Item button, CommandContext commandContext) +732
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext) +330
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext, Boolean isContextual, String id) +204
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunk(HtmlTextWriter output, Item chunk, CommandContext commandContext, Boolean isContextual) +242
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderChunks(HtmlTextWriter output, Item strip, CommandContext commandContext, Boolean isContextual) +442
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderStrips(HtmlTextWriter output, Item ribbon, Boolean isContextual, ListString visibleStripList) +800
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.RenderStrips(HtmlTextWriter output, Item defaultRibbon, Item contextualRibbon, ListString visibleStripList) +215
Sitecore.Web.UI.WebControls.Ribbons.Ribbon.Render(HtmlTextWriter output) +610
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +149
Sitecore.Web.HtmlUtil.RenderControl(Control ctl) +74
Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.RenderRibbon(Item item) +603
Sitecore.Shell.Applications.WebEdit.WebEditRibbonForm.OnLoad(EventArgs e) +1238

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +76
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +193
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +35
Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +337
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

最佳答案

从堆栈跟踪信息看来问题出在 My Items功能区中的按钮。

enter image description here

似乎由于某种原因,在加载此按钮时执行的快速查询返回包含空值的项目列表。你有任何自定义数据提供者吗?

您可以尝试两种解决方案:

  • 清除缓存 /sitecore/admin/cache.aspx
  • 通过以 运行此查询来查找导致问题的项目管理员

  • Item[] items = Sitecore.Client.ContentDatabase.SelectItems(
    "fast://*[@__lock='%\"full-username-which-experienced-exception-with-domain-name\"%']");

    另一个选项是从功能区隐藏此按钮(在 core 数据库中删除或更改 /sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Page Editor/Edit/My Items 的安全权限)。根据我的经验,这个按钮很少用于 Page Editor模式并且可以减慢速度 Page Editor每次加载此模式时, My items按钮计算当前用户锁定的所有文章,因此无论如何删除它可能是个好主意。

    关于sitecore - 页面预览期间的功能区控件异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18086787/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com