【问题标题】:Sharepoint Edit Form ErrorSharepoint 编辑表单错误
【发布时间】:2011-06-06 15:09:06
【问题描述】:

我找不到胶水。尝试在浏览器中编辑 Listitem 时,日志显示错误:

找不到文件:C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Layouts\EditingMenu\SiteAction.xml System.ArgumentNullException:Der Wert darf nicht NULL sein。参数名称:s bei System.IO.StringReader..ctor(String s) bei System.Xml.XmlDocument.LoadXml(String xml) bei Microsoft.SharePoint.Publishing.Internal.WorkflowUtilities.FlattenXmlToHashtable(String strXml) bei Microsoft.SharePoint.Publishing .Internal.WorkflowUtilities.DoesWorkflowCancelWhenItemEdited(String associationXml) 在 Microsoft.SharePoint.Publishing.WebControls.ConsoleDataSource.EnsurePageNotInLockingWorkflowIfInEditMode() 在 Microsoft.SharePoint.Publishing.WebControls.ConsoleDataSource.OnPreRender(EventArgs e) 在 System.Web.UI.Control.PreRenderRecursiveInternal () bei System.Web.UI.Control.PreRenderRecursiveInternal() bei System.Web.UI.Control.PreRenderRecursiveInternal() bei Sy... 489b3ebb-eb93-4172- SharePoint Foundation 运行时 tkau 意外 System.Web.UI.Page。 ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Xml 已就位,同一 Web 中其他列表的编辑表单运行良好......甚至尝试制作新的 Editform(和 iisreset 等)。

任何提示都会有所帮助

谢谢拉尔斯

【问题讨论】:

  • 为了让它更加混乱,它仍然适用于 3 个非常旧的条目,其中没有引入必需的查找字段。编辑其中一个会使它们损坏,恢复到第一个版本仍然会使它们损坏将字段更改为不需要并制作没有它们的新条目也会产生损坏的项目我真的不知道..

标签: forms sharepoint-2010


【解决方案1】:

引发异常是因为 SharePoint 2010 期望 AssociationData 元素包含有效的 xml,其中 AssociationData 元素是工作流定义架构中的一个标记。在将我们的 SP 2007 应用程序迁移到 SP 2010 后,我遇到了这个问题。不幸的是,仅将有效的 xml 应用于工作流定义中的 AssociationData 元素是不够的:

它仅对修改后创建/启动的应用程序和工作流实例有帮助。因此,对于实时应用程序和启动的工作流实例,我们必须通过对象模型更改 AssociationData。我实现了我在此处描述的一组方法 - SharePoint: Workflow + List Item Edit Form = Value cannot be null Exception。基本方法如下:

public static void AdjustAssociationData(SPWorkflowAssociation workflowAssociation, SPWorkflowAssociationCollection collection)
{
    if (!IsValidXml(workflowAssociation.AssociationData))
    {
        string newValue = string.IsNullOrEmpty(workflowAssociation.AssociationData)
                                ? "<Data />"
                                : string.Format("<Data>{0}</Data>", workflowAssociation.AssociationData);
        workflowAssociation.AssociationData = newValue;
        collection.Update(workflowAssociation);
    }
}

public static bool IsValidXml(string str)
{
    if (!string.IsNullOrEmpty(str))
    {
        try
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(str);
            return true;
        }
        catch {}
    }
    return false;
}

另外,从我上面提到的博客文章中,您可以下载我针对我们的问题 sp 应用程序开发和使用的控制台应用程序。 我希望这会有用。

【讨论】:

    【解决方案2】:

    事实上,元素内容类型附有一个处置批准工作流,不知道是谁把它放在那里,但无论如何都可以在列表中找到任务。工作流程对我来说几乎是不可见的。错误很奇怪,我没想到

    拉尔斯

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-05
      • 2013-05-26
      • 1970-01-01
      • 2013-09-08
      • 2019-10-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多