Forum Discussion

Thomas N. Sørensen's avatar
Thomas N. Sørensen
Copper Contributor
Sep 16, 2016

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

 

6 Replies

  • 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.

    • Thomas N. Sørensen's avatar
      Thomas N. Sørensen
      Copper Contributor

      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);
      }                
      • Luis Mañez's avatar
        Luis Mañez
        MVP
        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!

Resources