-
Notifications
You must be signed in to change notification settings - Fork 636
GetProvisioningTemplate: add ability to exclude fields and content types that came from content type hub #1208
Description
Category
- Enhancement
Environment
[ ] Office 365 / SharePoint Online
[x] SharePoint 2016, May 2017 CU
[ ] SharePoint 2013
Not environment-dependent
Observed Behavior
Templates exported with (GetProvisioningTemplate) contain fields and content types that came from content type hub, and there is no way to exclude them with ProvisioningTemplateCreationInformation properties or Handlers.
Global content types and fields misrepresent actual site configuration and can create conflicts during site configuration migration between site collections , web applications and farms (e.g. unable to override read only content types).
Expected or Desired Behavior
Add a way to include/exclude fields and content types that came from Content Type Hub. For example
- Do not export fields and content types that came from content type hub by default
- Add Boolean property
IncludeAllFields - Add Boolean property
IncludeAllContentTypes
Global fields and content types would have property SourceId = ContentTypeHub.WebId
Steps to Reproduce
- Create a few fields on the Content type Hub site
- Use these fields in a few new content types
- Publish the content types
- Wait until the content types appear in the subscriber sites (or, run Publish and Subscribe timer jobs)
- Add a few fields and content types to the subscriber site.
- Export subscriber site template, e.g.
Get-PnPProvisioningTemplate -Out "subscriber-site.export.xml"- Notice that the fields and content types created in the content type hub appear in the template along with the subscriber site only fields and content types.
- Make a few changes in the Content Type Hub site fields and content types (e.g. change descriptions) and re-publish the content types
- Create another subscriber site and provision the exported template to the new site
- Most likely, you are going to experience errors during import when the engine is going to try updating read only fields and content types that came from the content type hub site.