Home

PnP Provisioning Framework - Referenced content type not available in site or template

Highlighted
New Contributor

PnP Provisioning Framework - Referenced content type not available in site or template

Using PnP SiteProvisioning framework OfficeDevPnP.Core (v. 2.7.1609.3).

 

Extracting template from SharePoint Online with lcid 1033 (English site) and applying to english OnPrem 2013 site => everytning ok

Extracting template from SharePoint Online with lcid 1030 (Danish site) and applying to Danish OnPrem 2013 site => Error:

 

 

Referenced content type 0x0101009D1CB255DA76424F860D91F20E6C4118 not available in site or in template

 

 

The above can be reproduced with a 100% standard created team site - no customization, branding what so ever applied before extracting template. 

Using pnp filetype to save extracted template. The english template generates a very small pnp file (without all the default lists, fields etc.). But the Danish template includes all the default lists (with danish names). The SitePages list includes a content type with ID 0x0101009D1CB255DA76424F860D91F20E6C4118, which is not present and gives the error above.

 

 

 <pnp:ListInstance Title="Webstedssider" Description="" DocumentTemplate="" TemplateType="119" Url="SitePages" EnableVersioning="true" MinorVersionLimit="0" MaxVersionLimit="0" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-c796-4402-9f2f-0eb9a6e71b18" ContentTypesEnabled="true" EnableAttachments="false" EnableFolderCreation="false">
          <pnp:ContentTypeBindings>
            <pnp:ContentTypeBinding ContentTypeID="0x010108" Default="true" />
            <pnp:ContentTypeBinding ContentTypeID="0x0120" />
            <pnp:ContentTypeBinding ContentTypeID="0x01010901" />
            <pnp:ContentTypeBinding ContentTypeID="0x0101009D1CB255DA76424F860D91F20E6C4118" />
          </pnp:ContentTypeBindings>

 

Are we missing anything in order to get the PnP Provisioning framework to work with Danish templates? - of course we can manually edit the generated pnp file and erase all the extra content incl. the offending ContentType, but we would rather have a 100% automated solution, where templates are extracted on the fly and working for both Danish and English templates.

 

Any ideas?

 

Best regards,

Thomas

 

See more conversations labeled with:

6 Replies

Re: PnP Provisioning Framework - Referenced content type not available in site or template

Are you using a Developer tenant in SP Online? I'm asking cos that content type ID has only a search result in the entire Google here!:

 

https://github.com/SharePoint/sp-dev-docs/blob/master/workbench.aspx

 

Not sure why PnP is adding all these lists when the language is none-english, but if I'm right with my assumptions, I sugest you to test the same from a none-developer SP Online tenant, as that content type seems very specific to the new SP Development framework, and is not available in your On Prem tenant.

 

Let us know how it works.

Re: PnP Provisioning Framework - Referenced content type not available in site or template

It is not a Developer Tenant. Not sure where this contenttype originates from, and as I wrote it only appears in non-english templates. 

For now I have solved it by having code like the following, running on the loaded template when provisioning on-prem:

ContentTypeBinding bindingToLookFor = new ContentTypeBinding();
bindingToLookFor.ContentTypeId = "0x0101009D1CB255DA76424F860D91F20E6C4118";
var offendingLists = template.Lists.Where(l => l.ContentTypeBindings.Contains(bindingToLookFor));
foreach (var l in offendingLists)
{
    l.ContentTypeBindings.Remove(bindingToLookFor);
}                

Re: PnP Provisioning Framework - Referenced content type not available in site or template

It's really weird. I tested the provisioning framework some tima ago on a non-english tenant and worked fine. That content type is not documented anywhere, so I'd still think that is something related with that tenant. Anyway, thanks for sharing the workaround!

Re: PnP Provisioning Framework - Referenced content type not available in site or template

I am using US English, and I am getting the same error while using the team site, I am using the latest PnP ver 2.13.1703.  Sometimes, it works though.  Any ideas?

Re: PnP Provisioning Framework - Referenced content type not available in site or template

Interesting. Now there's much more information about that Content Type. This CT is the one used in Modern Sites, to specify Modern Pages:
https://msdn.microsoft.com/en-us/pnp_articles/modern-experience-customizations-customize-pages

The only thing that I can think, is that if you Export the template from a Modern Site, and apply it to a non-modern site, you could get that issue, as the CT could be not present in a non-modern site.

Can you elaborate the case when it works?

Thanks.

Re: PnP Provisioning Framework - Referenced content type not available in site or template

I tried to filter out the content type, but it does not get inside the for loop of the template I am using so these do not exist in my template.  But, I still got the error.  I generated a new template out of a vanilla site online and I was able to provision that template.  I had some objects that were generated from on-prem, I wonder whether that is causing the error.

Related Conversations
Enable modern site pages
Odd Arne Nohr  in  SharePoint  on
9 Replies
Stop Opening Links in New Tabs
Joe Fedorowicz  in  SharePoint  on
5 Replies
Site Contents doesn't load in Chrome
Matt Coats  in  SharePoint  on
4 Replies