Open LouFarho opened 6 years ago
I can reproduce this with standard modern Team Site in two different tenants. Only change that my template site has is change of (modern) theme.
If that is done, Apply-PnPProvisioningTemplate fails: Apply-PnPProvisioningTemplate : Value cannot be null. Parameter name: masterPageServerRelativeUrl
The error goes away if -ExcludeHandlers ComposedLook is added to apply cmdlet. But there will be no modern theme applied to the new site.
According to https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-theming/sharepoint-site-theming-csom - "There's currently no supported API to programmatically apply a theme to specific site."
Any ideas?
Correct. The moment the API is there (it's on its way) we can implement the modern theme functionality in the engine. It could be an option that is the site is a 'modern' site, we simply skip the handling of composed looks in general.
In this case I can use site script/design to apply the theme because I learned that customer tenant is actually running on Targeted release,
Adding the -ExcludeHandlers ComposedLook this works. Thanks for the pointer to the fix. I am trying to provision image files as part of the news pages. But while generating the template the
Category
[x ] Bug [ ] Enhancement
Environment
[x ] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013
Expected or Desired Behavior
Expect the applying of a template to complete without throwing an error
Observed Behavior
Apply-PnPProvisioningTemplate : Value cannot be null. Parameter name: masterPageServerRelativeUrl At line:1 char:1
Steps to Reproduce
Created a Communication site (Topic) to be used as a template. Modified the theme Modified the homepage hero web part by changing text and image displayed Executed after connecting to the site using connect-pnponline Get-PnPprovisioningtemplate -Out F:\LapTop\Projects\SPOTemplates\PNPTopic.pnp
Used a previously create OOTB Communication site (Topic) Executed after connecting to the target site using connect-pnponline Set-PnPTraceLog -On -LogFile "$($pathOFTemplate)log_$($siteName).txt" -Level Debug Apply-PnPProvisioningTemplate F:\LapTop\Projects\SPOTemplates\PNPTopic.pnp
Since there was an update, I retried all the steps to see if anything changed. I went thru the log file and I did not see anything regarding this error. The log is attached. log_.txt
Name Version
SharePointPnPPowerShellOnline 2.20.1711.0 SharePointPnPPowerShellOnline 2.19.1710.2
I am new at using the SharePoint PnP and the provisioning so if I am not using this as expected feel free to let me know. I wanted just wanted to perform a "simple" copy of one communication site to another communication site.