Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

GetProvisioningTemplate: add ability to exclude fields and content types that came from content type hub #1208

Closed
ruslanurban opened this issue Jun 7, 2017 · 3 comments

Comments

@ruslanurban
Copy link

ruslanurban commented Jun 7, 2017

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.
stevebeauge added a commit to solutions-pour-sharepoint/PnP-Sites-Core that referenced this issue Jun 19, 2017
Determine during export of a content type if it was provisionned through content type syndication.
@stevebeauge
Copy link
Contributor

Having the same issue. I fixed it and submitted a PR #1222 .

Let's see if it can help.

@spdevdocs
Copy link

We closed this issue as it had not been any activity within last 180 days. This is a generic process we have decided to perform for issues, which have not been explicitly marked still to be "work in progress" based on tags. We are performing this cleaning to make sure that old issues that have already been solved (but not closed) or are no longer relevant are cleaned out and make the issues more manageable. If this issue still valid, we would ask you to open a new issue and follow the guidance in the issue template related to the recommended location. We do apologize for any inconveniences this might cause. Please do remember that issues on the issue lists are also messages for others in the community, so you can also check if you can assist on any of them. “Sharing is caring!”

@NicolajHedeager
Copy link
Contributor

Ability to exclude fields is fixed in this PR #2565

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants