Adding existing content types to library deletes them in 1.3.0
See original GitHub issueI am adding extra content types defined on the Site level to the “Documents” library via a provisioning template (first, third and fourth line in pnp:ContentTypeBindings):
<pnp:Lists>
<pnp:ListInstance Title="Dokumenty" Description="" DocumentTemplate="{site}/Sdilene dokumenty/Forms/template.dotx" OnQuickLaunch="true" TemplateType="101" Url="Sdilene dokumenty" EnableVersioning="true" MinorVersionLimit="0" MaxVersionLimit="500" DraftVersionVisibility="0" TemplateFeatureID="00bfea71-e717-4e80-aa17-d0c71b360101" ContentTypesEnabled="true" EnableAttachments="false" DefaultDisplayFormUrl="{site}/Sdilene dokumenty/Forms/DispForm.aspx" DefaultEditFormUrl="{site}/Sdilene dokumenty/Forms/EditForm.aspx" DefaultNewFormUrl="{site}/Sdilene dokumenty/Forms/Upload.aspx" ImageUrl="/_layouts/15/images/itdl.png?rev=47" IrmExpire="false" IrmReject="false" IsApplicationList="false" ReadSecurity="0" WriteSecurity="0" ValidationFormula="" ValidationMessage="" EnableFolderCreation="false" >
<pnp:ContentTypeBindings>
<pnp:ContentTypeBinding ContentTypeID="0x010100BF87545EA10ECE43B34F659BC08D9129" Default="true"/>
<pnp:ContentTypeBinding ContentTypeID="0x0120"/>
<pnp:ContentTypeBinding ContentTypeID="0x0120D52000E31C3CDFB447B943AA017C95EE1660BA"/>
<pnp:ContentTypeBinding ContentTypeID="0x0101008D022B8BE33B8242BD95268C8C48D66C"/>
<pnp:ContentTypeBinding ContentTypeID="0x0101" Remove="true"/>
<pnp:ContentTypeBinding ContentTypeID="0x0120D520" Remove="true"/>
</pnp:ContentTypeBindings>
In PnP.PowerShell 1.2.0 it worked as expected, but after installing 1.3.0 version, it suddenly started to delete the content types from the library.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Add a content type to a list or library
Go to the settings for the list or library. Under Content Types, select Add from existing site content types. If Content Types doesn't...
Read more >13 Working with Libraries
This chapter describes how to create, secure, modify, and delete libraries. It has the following topics: About Document Libraries · Creating an Enterprise ......
Read more >Library administration
Delete libraries. This action is only available if there are no content using the library and there are no other libraries dependent of...
Read more >Add-Remove Content Types to SharePoint List or Library ...
On the “Add Content Types” page, in the “Available Site Content Types” section, select the content types you want to add to the...
Read more >Appcompat | Jetpack
Declaring dependencies. To add a dependency on Appcompat, you must add the Google Maven repository to your project. Read Google's Maven repository for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Tested on 1.3.7 and it worked correctly.
Attaching simplified template for Shared Documents - it creates a test site content type and then tries to attach the content type to the Shared Documents library (and delete default Document content type):
On 1.2.0 it works, on 1.3.0 it tries to delete the “TestContentType” from the library.