Content type not visible in new button with Add-PnpContentTypeToList
###Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:###
- Are you using
Apply-SPOProvisioningTemplateorGet-SPOProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues. - Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
- If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/OfficeDev/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/officedev/PnP-Sites-Core/issues
Reporting an Issue or Missing Feature
When adding a content type to a list with the cmdlet Add-PnpContentTypeToList it is not marked as visible unless you set is as the default content type. As workaround I added it as the default content type and used the cmdlet Set-PnpDefaultContentTypeToList to reset the original default content type, but this cmdlet doensn't change the default.
Expected behavior
Possibility to add content type that is visbile on the new button. Use SetPnpDefaultContentTypeToList to change default content type
Actual behavior
Adding non-default content type is not visible in new button and changing default content type not working
Steps to reproduce behavior
Please include complete code samples in-line or linked from gists
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [X] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
(you can retrieve this by executing Get-Module -Name *pnppowershell* -ListAvailable)
2.18.1709.1
How did you install the PnP-PowerShell Cmdlets?
- [ ] MSI Installed downloaded from GitHub
- [X] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
Hi,
Any time frame when this enhancement will be included? Thanks
Regards,
Kashif
Hi Erwin,
I'm not sure this is an enhancement as I'm seeing different behaviours between two tenancies so potentially this is a server side issue? In my first release tenant, adding a new content type to a list automatically assigns it to both the New drop down in the library command bar and also makes the content type available in the property drop down in the modern library experience when editing a documents properties.
In a non-first release tenant, I'm seeing the same behaviour as PaWeg, the content type is added, but you have to manually make it available on the new bar through the UI.
Paul.
Yeah, definitely inconsistent.
JOE FEDOROWICZ HARMELIN MEDIA | SR. SYSTEMS ADMINISTRATOR t: 484.270.9541 c: 215.738.1489
From: cimares [email protected] Sent: Monday, March 26, 2018 11:38:03 AM To: SharePoint/PnP-PowerShell Cc: Joe Fedorowicz; Comment Subject: Re: [SharePoint/PnP-PowerShell] Content type not visible in new button with Add-PnpContentTypeToList (#1101)
Hi Erwin,
I'm not sure this is an enhancement as I'm seeing different behaviours between two tenancies so potentially this is a server side issue? In my first release tenant, adding a new content type to a list automatically assigns it to both the New drop down in the library command bar and also makes the content type available in the property drop down in the modern library experience when editing a documents properties.
In a non-first release tenant, I'm seeing the same behaviour as PaWeg, the content type is added, but you have to manually make it available on the new bar through the UI.
Paul.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/SharePoint/PnP-PowerShell/issues/1101#issuecomment-376210578, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Afb0MgslHRIwHx8azKiV-RQ8u1H8T27Dks5tiQtbgaJpZM4PfEdz.
I'm just testing this for a large DMS deployment, and in the tenant that is playing up, I have 6 content types assigned to the list. Only the default is showing as available on the new menu. If I add a new content-type to the list, but with the default flag selected.. ALL of the previously invisible content types are suddenly added to the new menu button (and all are suddenly ticked in the UI).
Removing the content type leaves everything corrected with all content types visible in the UI. Definitely server side and not an issue with the PNP cmdlet as I'm not seeing this behaviour in my other tenant with the same script/PNP dlls.
Paul.
#Update# Now it's doing the same in my first release tenant. Some weird results here. Going to test and see if it does the same using CSOM.
#Further Update# I've since recreated this problem using pure CSOM which has the same issue, therefore it looks like a bug with Microsoft's underlying CSOM rather than the PNP implementation.
For now, if you use Add-PNPContentTypeToList to add all the content types, then call Set-PnPDefaultContentTypeToList to set your default, it seems to enable all of the other content types at the same time. (workaround blogged here)