网站栏、页面布局等在功能停用时不会被删除
我编写了一个发布功能,它创建一些网站栏、引用这些网站栏的内容类型、母版页和一些页面布局。
当我停用此功能时,网站栏、母版页和页面布局不会从其库中删除。
我在这里做错了什么?
我应该编写一个事件处理程序来删除这些文件吗?停用应该开箱即用吗?
I have written a publishing feature which creates some site columns, a content type referring these site columns, a master page and some page layouts.
When I deactivate this feature, the site columns, the master page and the page layouts are not getting deleted from their gallery.
What am I doing wrong here?
Should I be writing an event handler for deleting these files? Shoudnt the deactivation take care of it out of the box?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SharePoint 永远不会删除任何可能导致用户在停用功能时丢失数据/更改的类型的工件。用户可能已经使用/更改了您网站的内容类型列,并且她可能已经自定义了母版页或页面布局。
即使用户没有对工件进行任何使用/更改,这种不删除仍然有效。这很好,因为如果您确定要删除它们,那么您始终可以在功能接收器中执行此操作,而不必检查 SP 是否删除了它们。
SharePoint will never remove any artifacts of a type which potentially could cause a user to loose data/changes as part of deactivation of a feature. A user could have used/changed your site column of contenttype and she could have customized the masterpage or page layout.
This non removal is in effect even though the user didn't make any use/change of the artifacts. Which is good because then if you're sure you want to remove them then you can always do it in a feature receiver and don't have to check is SP removed them.