在事件 ItemCheckingOut 上,properties.ListItem 为 null

发布于 2024-07-23 08:16:13 字数 463 浏览 8 评论 0原文

我遇到了最奇怪的错误。

如果有人能给我提示,我没有发现任何与谷歌相关的内容。

当我在包含 6 个项目的文档库 (TemplateType=101) 上挂钩 ItemCheckingOut 上的事件时,所有这些项目的properties.ListItem 将始终为 null。

这以前从未发生过。 该问题似乎与这些文件部署在带有 WSS Extensions 1.2 的功能中这一事实有关。

这是我所做的:

  • 如果我尝试访问列表并手动获取项目,则计数返回 0。
  • 如果我尝试手动获取文件(即使 sharepoint 说它不存在),我无法使对它的任何操作(在本例中为 OpenBinary)都会抛出异常。
  • 创建一个未由同一列表内的功能部署的新文件,仅对于该特定元素,“properties.ListItem”不再为空。

有人有主意吗?

I am having the weirdest error.

If anyone can give me hints, I've found nothing relevant with Google.

When I hook the events on ItemCheckingOut on a Document Library (TemplateType=101) with 6 items inside, properties.ListItem will always be null for all those items.

This never happened before. The problem seem related to the fact that those files are deployed in Feature with WSS Extensions 1.2.

Here is what I have done:

  • If I try to access the list and get the items manually, the count return 0.
  • If I try to get the file manually (even though sharepoint say it doesn't exist), I can't make any operation on it (OpenBinary in this case) and it will throw.
  • Creating a new file that is not deployed by feature inside the same list make the "properties.ListItem" not null again for this specific element only.

Anyone have an idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雅心素梦 2024-07-30 08:16:13

一切都表明文件没有正确部署到列表中。 我会仔细检查您如何在该功能中指定文件。 (注意:您可以成功获取不存在的文件的 SPFile 对象!这就是您在第二个要点中观察到的内容)。 elements.xml 文件中的类型是否指定为 GhostableInLibrary?

Everything points to the files not being correctly deployed to the list. I'd double-check how you're specifying the files in the feature. (Note: you can successfully get an SPFile object for a file which does not exist! That's what your observation in your second bullet point shows). Is the type in the elements.xml file specified as GhostableInLibrary?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文