【问题标题】:"Empty strings are not allowed" error when adding Sitecore placeholder添加 Sitecore 占位符时出现“不允许空字符串”错误
【发布时间】:2013-09-06 14:22:48
【问题描述】:

在 Sitecore 6.5 中尝试向布局添加占位符时收到以下错误消息:

“不允许空字符串。
参数名称:xml”

知道可能是什么问题吗?日志中出现以下堆栈跟踪:

1124 10:20:56 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_default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\59ed33b7\d6112557\App_Web_edgk4py3.1.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 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Sitecore.Reflection.ReflectionUtil.CallMethod(Type type, Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Object[] parameters)
   at Sitecore.Reflection.ReflectionUtil.CallMethod(Object obj, String methodName, Boolean includeNonPublic, Boolean includeInherited, Object[] parameters)
   at Sitecore.Web.UI.HtmlControls.Component.HandleMessage(Message message)
   at Sitecore.Shell.Framework.Commands.ClientEventCommand.SendEventMessage()
   at Sitecore.Shell.Framework.Commands.ClientEventCommand.Execute(CommandContext context)
   at Sitecore.Web.UI.Sheer.ClientPage.RaiseEvent()
   at Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Nested Exception

Exception: System.ArgumentException
Message: Empty strings are not allowed.
Parameter name: xml
Source: Sitecore.Kernel
   at Sitecore.Diagnostics.Assert.ArgumentNotNullOrEmpty(String argument, String argumentName)
   at Sitecore.Layouts.LayoutDefinition.Parse(String xml)
   at Sitecore.Shell.Applications.Layouts.DeviceEditor.DeviceEditorForm.OnOK(Object sender, EventArgs args)

【问题讨论】:

  • 我不在这个网站上,但他们有时会在我工作的地方使用它。这个网站确实是从一个使用 CIG 的网站的克隆开始的。
  • 您还有其他信息吗?堆栈跟踪会有所帮助
  • @Maras Musielak:不,这是对话框中错误消息的全部内容。没有堆栈跟踪。
  • @Maras Musielak:我在日志中发现了一个堆栈跟踪,并在上面添加了它。谢谢!

标签: sitecore


【解决方案1】:

我遇到了这个问题,发现问题的根源是 web.config 中的设置 InvalidItemNameCharsItemNameValidation 为空白。

一旦我将值恢复为默认值,我已经删除了导入包含无效字符的包的值,如下所示,异常停止发生。

<setting name="InvalidItemNameChars" value="\/:?&quot;&lt;>|[]" />

<setting name="ItemNameValidation" value="^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$" />

【讨论】:

    【解决方案2】:

    最常见的是,这与您的语言设置有关。比如说;如果您的用户(通过默认内容语言)设置为以某种语言编辑项目,则您正在编辑的当前项目没有特定语言的版本。

    例如;您正在使用“en”中存在的项目 - 以及您登录的用户;默认为“da-DK” - 并且当前项目在“da-DK”中没有版本。

    虽然我已经很久没有看到这个错误了,我会认为它已修复。

    可能根本不是这个问题,但从你对这个问题的有限信息中很难判断。

    查看您的用户设置;此外,如果您的网站定义中定义的任何“ContentLanguage”属性可能不是您所期望的。

    【讨论】:

    • 话虽如此;触发异常的代码与设备设置有关。您是否对 Sitecore 随附的默认设备进行了任何修改?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-01
    • 1970-01-01
    • 2015-10-04
    • 1970-01-01
    相关资源
    最近更新 更多