Git Product home page Git Product logo

pnp-sites-core's Introduction

PnP Sites Core Library - ARCHIVED

Important: PnP Sites Core has been retired and archived. PnP Framework offers the same features as a .NET Standard 2.0 and .NET 5 package and we'll only maintain that version going forward. Please switch to PnP Framework if you're still using PnP Sites Core in your projects.

The PnP Sites Core library is a very popular library that extends SharePoint using mainly CSOM. This library contains the PnP Provisioning engine, tons of extension methods, a modern page API, etc...but this library has also organically grown into a complex and hard to maintain code base. One of the reasons why the PnP Core SDK development started is to provide a new clean basis for the PnP Sites Core library with a strong focus on quality (test coverage above 80%, automation). As this transition will take quite some time and effort we plan to gradually move things over from PnP Sites Core to the PnP Core SDK. The first step in this transition is releasing a .Net Standard 2.0 version of PnP Sites Core, called PnP Framework. Going forward PnP Framework features will move to the PnP Core SDK in a phased approach. PnP Framework version 1.0.0 (GA 🎉) is available and beta 2 of the PnP Core SDK is available as well.

PnP dotnet roadmap

I've found a bug, where do I need to log an issue or create a PR

Given PnP Sites Core has been archived issues and PR's need to be created in the PnP Framework repository.

Community rocks, sharing is caring!

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

pnp-sites-core's People

Contributors

afsandeberg avatar artokai avatar baywet avatar erwinvanhunen avatar gautamdsheth avatar gszdev avatar heinrich-ulbricht avatar ivanvagunin avatar jackpoz avatar jansenbe avatar jensotto avatar koenzomers avatar lafe avatar laurakokkarinen avatar luismanez avatar mrpullen avatar nicolajhedeager avatar okms avatar paolopia avatar patrikhellgren avatar paulpascha avatar s-kainet avatar schaudk avatar stevebeauge avatar teodorai avatar teroarvola avatar thejeffer avatar vesajuvonen avatar wobba avatar ypcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pnp-sites-core's Issues

Error applying a template to a Sub site with a ListInstance containing a Custom Content Type

If you are applying a template to a Site that is not the RootSite, and the template has a ListInstance with a Custom Content Type, and that Content Type was added only in the RootSite, the CT will not be applied to the list, and also, if you are adding a View to the list using any field of the custom CT, code will raise an error.

This is because the CreateList function in the ObjectListInstance.cs is calling:
var tempCT = web.GetContentTypeById(ctBinding.ContentTypeId);
and by default, that function is looking for the ContentType in the web.ContentTypes.

The solution is just change the calling to that function as:
var tempCT = web.GetContentTypeById(ctBinding.ContentTypeId, searchInSiteHierarchy: true);

Perhaps would be better if by default, the function set the 2nd param to True.

I'm trying to configure the environment and do a Pull request for that change (as I'd like to contribute if I find more issues).

Subsite SiteFields and Site Content Type not extracted in via pnp

PnP Engine does not extract site columns and site contentype from subsite, I looked at code and ObjectField Class --> ExtractObjects Methods check for subsite and if that is case it does not extract any of them, is there a reason or it is not recommended to deploy site columns and site content type at subsite?

Template Engine does not store and restore list settings for Quick Edit and Dialog

The templating engine does not store and therefore also does not restore the list settings "Allow items in this list to be edited using Quick Edit?" and "Launch forms in a dialog?".

I know that the reason is that the properties "NavigateForFormsPages" (for dialogs) and "DisableGridEditing" are missing in the CSOM, but maybe an additional issue can help to add these missing properties.

Managed Metadata fields are not exported properly

As I had some issues importing my templates with Taxonomy fields I ran the following test.
I've created two site collections (both publishing portals)

/sites/source
/sites/target

Then I ran the following PowerShell:

Connect-SPOnline -Url https://pieterveenstratest.sharepoint.com/sites/source -Credentials $credentials

$web = Get-SPOWeb
Get-SPOProvisioningTemplate -Out C:\Template.xml -Schema V201505 -Web $web

Connect-SPOnline -Url https://pieterveenstratest.sharepoint.com/sites/target -Credentials $credentials

$targetweb = Get-SPOWeb

Apply-SPOProvisioningTemplate -Path C:\Template.xml -Web $targetweb

This is all working fine.

Then I added a Managed Metadata field to my source site and reran the above PowerShell. My template.xml contains the following section:

< Field Type="TaxonomyFieldType" DisplayName="testMM" List="Lists/TaxonomyHiddenList" WebId="fbb2a609-6c5b-4306-994d-cf6818118687" ShowField="Term1033" Required="FALSE" EnforceUniqueValues="FALSE" Group="Custom Columns" ID="{f4a950ec-87d1-4d00-9243-a59ad779c943}" SourceID="{fbb2a609-6c5b-4306-994d-cf6818118687}" StaticName="testMM" Name="testMM">
< Default>
< /Default>
< Customization>
< ArrayOfProperty>
< Property>
< Name>SspId< /Name>
< Value xmlns:q1="http://www.w3.org/2001/XMLSchema" p4:type="q1:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">6ec0c05d-3e14-4cf1-b1f5-317f9653c8c2< /Value>
< /Property>
< Property>
< Name>GroupId< /Name>
< /Property>
< Property>
< Name>TermSetId< /Name>
< Value xmlns:q2="http://www.w3.org/2001/XMLSchema" p4:type="q2:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">766f7f55-9e17-4c7b-851a-2641685c57ec< /Value>
< /Property>
< Property>
< Name>AnchorId< /Name>
< Value xmlns:q3="http://www.w3.org/2001/XMLSchema" p4:type="q3:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">b1345b59-65ed-499b-b1cb-b9571f8bfcfd< /Value>
< /Property>
< Property>
< Name>UserCreated< /Name>
< Value xmlns:q4="http://www.w3.org/2001/XMLSchema" p4:type="q4:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false< /Value>
< /Property>
< Property>
< Name>Open< /Name>
< Value xmlns:q5="http://www.w3.org/2001/XMLSchema" p4:type="q5:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false< /Value>
< /Property>
< Property>
< Name>TextField< /Name>
< Value xmlns:q6="http://www.w3.org/2001/XMLSchema" p4:type="q6:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">{3cc476ca-817b-45a3-82b7-1117226ea6af}< /Value>
< /Property>
< Property>
< Name>IsPathRendered< /Name>
< Value xmlns:q7="http://www.w3.org/2001/XMLSchema" p4:type="q7:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false
< /Property>
< Property>
< Name>IsKeyword< /Name>
< Value xmlns:q8="http://www.w3.org/2001/XMLSchema" p4:type="q8:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false
< /Property>
< Property>
< Name>TargetTemplate< /Name>
< /Property>
< Property>
< Name>CreateValuesInEditForm< /Name>
< Value xmlns:q9="http://www.w3.org/2001/XMLSchema" p4:type="q9:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">false< /Value>
< /Property>
< Property>
< Name>FilterAssemblyStrongName< /Name>
< Value xmlns:q10="http://www.w3.org/2001/XMLSchema" p4:type="q10:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Microsoft.SharePoint.Taxonomy, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
< /Property>
< Property>
< Name>FilterClassName< /Name>
< Value xmlns:q11="http://www.w3.org/2001/XMLSchema" p4:type="q11:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">Microsoft.SharePoint.Taxonomy.TaxonomyField< /Value>
< /Property>
< Property>
< Name>FilterMethodName
< Value xmlns:q12="http://www.w3.org/2001/XMLSchema" p4:type="q12:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">GetFilteringHtml
< /Property>
< Property>
< Name>FilterJavascriptProperty
< Value xmlns:q13="http://www.w3.org/2001/XMLSchema" p4:type="q13:string" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">FilteringJavascript< /Value>
< /Property>
< /ArrayOfProperty>
< /Customization>
< /Field>

The hidden text field with guid 3cc476ca-817b-45a3-82b7-1117226ea6af however is not included in my template.xml.

Within the ObjectField.cs I found code removing the hidden Taxonomy fields. (line 210). Why are these hidden fields removed? Are these not required as part of the import?

Content Type is not provisioned on List

We discovered that the PnP Provisioning Engine sometimes fails to add Content Types to lists. This happens if the Content Type is a derived Content Type from another Content Type and both Content Types should be assigned to the same list. In this case, the StartsWith method used in FieldAndContentTypeExtensions.ContentTypeExistsById looks at the second Content Type and sees that an already added Content Type starts with the same string. The algorithm incorrectly decides that the Content Type is already present and fails to add the second Content Type to the list.

List and RelationshipBehavior are removed when creating list-only lookup fields

If the engine is creating a list instance lookup column that doesn't exist, in ObjectListInstance/CreateField the call to PrepareField removes the List ID (and the Relationship Behavior) but the List ID is never added back. If I comment out the line to PrepareField() the issue goes away and the field is added as expected. I don't mind issuing a PR with the PrepareField commented out, but it seems someone wrote this function for a reason and I must confess to not fully understanding the reason for it (both attributes are respected and work as expected in my case so there must be some edge case its for...).

Importing Workflows

Exporting SharePoint designer workflows seems to be working. Importing workflows however gives me:

Apply-SPOProvisioningTemplate : Value cannot be null.
Parameter name: input

Is this a known issue or am I doing something wrong?

Custom Action Handler doesn't update the Sequence

Related with issue #177 I've also found that the Sequence property is not updated when you re-apply the template with the same Custom Action.
I am about to do a Pull Request to fix this bug, also including the change that @trickass has done in the PR #186 (just in case), but please, note that all the credit about the fix to set the Sequence is for @trickass

Provisioning Engine: Referencing a Taxonomy Field in a Content Type results in an error

I have created an XML file based on Office PnP Provisioning Schema. In this XML file I've added XML that defines a Taxonomy Field and there's also XML that binds this field to one of my custom Content Type which is also defined in the template XML.

Applying the template to one of my sites results in the following error:

"The property or field 'Id' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested."

Stacktrace:

at Microsoft.SharePoint.Client.ClientObject.CheckUninitializedProperty(String propName)
at Microsoft.SharePoint.Client.Field.get_Id()
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectContentType.UpdateContentType(Web web, ContentType existingContentType, ContentType templateContentType, TokenParser parser, PnPMonitoredScope scope)
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectContentType.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation)
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo)
at Microsoft.SharePoint.Client.WebExtensions.ApplyProvisioningTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation applyingInformation)
at ProvisioningConsole.Program.Main(String[] args) in D:\Source\PnP Provisioning Reference Implementation\ProvisioningConsole\Program.cs:line 45
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

{listid:<name>} issue in list view webpart

We are trying to add listview webpart with PnP file module with pnp:webpart pnp:Contents /pnp:Content/pnp:webpart, CDATA include .webpart file content exported from site and it required listid and we have used below line to resolve listid but pnp provisioning engine does not resolve listid.

{listid:QuickLinks}

Is it know issue or token is not supported in webpart content.

File deployment to Theme Catalog fails on Subsites

I have encountered an issue on-premise while using the Site Provisioning Engine. When trying to deploy files to a subsite, the Engine deploys those files to the wrong folder (e.g. "/sites/TargetRoom/Subsite/sites/TargetRoom/_catalogs/theme/15") instead of the Site Collection Theme Catalog that is present in the Root Web.
The problem is that the "{themecatalog}" token is replaced correctly with the URL to the Theme Catalog in the Root Web, but the following steps assume that the folder is located in the Subsite the Engine is working on.

Add-SPOPublishingPageLayout : Save Conflict

Within my project I am deploying multiple Page Layouts. Every now and then I'm getting errors like the ones below. in the example below the error mentions "Featured Article Page.aspx" but the layout that it fails on can be any of the deployed layouts. Also this error doesn't always occur.

This only seemed to have started happening since the end of last week when we picked up the latest development branch of the core and PowerShell commands.

Add-SPOPublishingPageLayout : Save Conflict
Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh
the page, and resubmit your changes.
At C:\Project\Installer\Modules\Office365Module\Office365Module.psm1:409 char:9

  •     Add-SPOPublishingPageLayout -SourceFilePath "$path\Data\Page  ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : WriteError: (:) [Add-SPOPublishingPageLayout], ServerException
    • FullyQualifiedErrorId : EXCEPTION,OfficeDevPnP.PowerShell.Commands.PageLayout.AddPublishingPageLayout

Add-SPOPublishingPageLayout : The URL '_catalogs/masterpage/Featured Article Page.aspx' is invalid. It may refer to a nonexistent file or
folder, or refer to a valid file or folder that is not in the current Web.
At C:\Project\Modules\Office365Module\Office365Module.psm1:410 char:9

  •     Add-SPOPublishingPageLayout -SourceFilePath "$path\Data\Page  ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : WriteError: (:) [Add-SPOPublishingPageLayout], ServerException
    • FullyQualifiedErrorId : EXCEPTION,OfficeDevPnP.PowerShell.Commands.PageLayout.AddPublishingPageLayout

CT check for not existing site column

On SP Prem it is possible to rollout a wsp with a ct definition with one ore more not existing linked fields. This bug comes only on light if you use this ct..
So if we export the ct to our xml we need a check for really existent fields. On the CSOM import side we get big trouble..
Tomorrow if I have access to my production environment I will upload a patch for this..

taxonomy fields only working in root web

We are using a lot of taxonomy fields and we found that the field definitions for the taxonomy fields in our template.xml (used by Apply-SPOProvisioningTemplate) for our root site includes the following :

List="Lists/TaxonomyHiddenList"

For templates used by sub sites (and also exported from subsites using the PowerShell command) this is set to
List="Guid"

Resulting in "The SPListItem being updated was not retrieved with all taxonomy fields." when we try to edit/update one of these fields.

In the root site our taxonomy fields are working but for subsites they are not.

In the subsites we then replaced the List=Guid with List="Lists/TaxonomyHiddenList" and then the taxonomy fields started working again.

So it looks like this is a problem with the export of taxonomy fields. For now we will manually replace the List=Guid lines with the correct information.

I will do some more investigation. Is anybody else seeing the same behaviour?

Remove-SPOContentTypeFromList not working on sub sites

I have an issue with the following on the default 'Documents' library that gets created when provisioning a new site:

add-SPOContentTypeToList -List "Documents" -ContentType "Team site document" -DefaultContentType
** This works, a new content type is added called 'Team site document' and is now the default CT **

Remove-SPOContentTypeFromList -List "Documents" -ContentType "Document"
** This doesn't work, the command runs but whatever I try the 'Document' content type never gets removed **

With testing the above does work on the top level site / root web but does not work on subsites.

Speaking to Luis Manez on Yammer he thinks its a similar issue to this:

#165

Template provisioning works but throws sometimes « vti_mastercssfilecache » does not exist.

If you provision a new site collection and then run the following template, you will get an issue « vti_mastercssfilecache » does not exist. This is an on and off issue.

image

Here's a the full stack trace:
Microsoft.SharePoint.Client.ServerException was unhandled
HResult=-2146233088
Message=Le champ ou la propriété « vti_mastercssfilecache » n’existe pas.
ServerErrorCode=-1
ServerErrorTraceCorrelationId=445a2c9d-50cc-2000-09f4-9f469bd16f9e
ServerErrorTypeName=Microsoft.SharePoint.Client.InvalidClientQueryException
ServerStackTrace=""
Source=Microsoft.SharePoint.Client.Runtime
StackTrace:
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay) in C:\Git\Repos\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\ClientContextExtensions.cs:line 54
at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryRetry(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay) in C:\Git\Repos\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\ClientContextExtensions.cs:line 36
at Microsoft.SharePoint.Client.WebExtensions.PropertyBagContainsKey(Web web, String key) in C:\Git\Repos\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\WebExtensions.cs:line 771
at Microsoft.SharePoint.Client.WebExtensions.GetIndexedPropertyBagKeys(Web web) in C:\Git\Repos\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\WebExtensions.cs:line 807
at Microsoft.SharePoint.Client.WebExtensions.AddIndexedPropertyBagKey(Web web, String key) in C:\Git\Repos\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\WebExtensions.cs:line 828
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectPersistTemplateInfo.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation) in C:\Git\Repos\PnP-Sites-Core\Core\OfficeDevPnP.Core\Framework\Provisioning\ObjectHandlers\ObjectPersistTemplateInfo.cs:line 26
at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo) in C:\Git\Repos\PnP-Sites-Core\Core\OfficeDevPnP.Core\Framework\Provisioning\ObjectHandlers\SiteToTemplateConversion.cs:line 177
at Microsoft.SharePoint.Client.WebExtensions.ApplyProvisioningTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation applyingInformation) in C:\Git\Repos\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\WebExtensions.cs:line 1037
at CDP.SharePoint.Provisioning.Program.Main(String[] args) in C:\DEVLC\CDP.SharePoint.RAC\Dev_RacOnline\CDP.SharePoint.RAC\CDP.SharePoint.Provisioning\Program.cs:line 83
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Added option to load extra properties

#105 is showing an interesting concept to allow core library users to dynamically control the properties that are being requested. This will result in more elegant code and better performance.

Ask: evaluate the broader usage of this approach

Builtin contenttypes exported in ListInstance

The export behaviour of content types on list instance has been changed from

                    if (ct.Parent != null)
                    {
                        //Add the parent to the list of content types
                        if (!BuiltInContentTypeId.Contains(ct.Parent.StringId))
                        {
                        list.ContentTypeBindings.Add(new ContentTypeBinding { ContentTypeId = ct.Parent.StringId, Default = count == 0 });
                        }
                    }
                    else
                    {
                        list.ContentTypeBindings.Add(new ContentTypeBinding { ContentTypeId = ct.StringId, Default = count == 0 });
                    }

to

                    list.ContentTypeBindings.Add(new ContentTypeBinding
                    {
                        ContentTypeId = ct.Parent != null ? ct.Parent.StringId : ct.StringId,
                        Default = count == 0
                    });

It means that if ContentTypesEnabled on the list is False on import, it will try to add the buildin content types and fail because they already exist.

I suggest that you revert the change or please explain the reason for the change.

Thanks.

Apply-SPOProvisioningTemplate fails with August Master but works with July Dev

Hi
If I run a Provisioning Template which was created in July (middle of) and worked without a hitch at the end of July, now fails with illegal field name with a GUID which corresponds to the SEOBrowserTitle field which is a standard Publishing Column with a display name of "Browser Title" whilst creating a Content Type. So the failure was a FieldRef inside the Content Type Definition in the Provisioning Template. I was running the on-premises PowerShell Command Apply-SPOProvisioningTemplate from the Master branch of the August Release when the failure occurred. The actual error was Apply-SPOProvisioningTemplate : Invalid field name. {ff92f929-d18b-46d4-9879-521378c689ef}

The OfficeDevPnP.core.dll which worked (and still works) was version 1.4.0815 - created on the 7th july at 21:16:24 and modified on the 28th July at 20:50.23.

Any ideas why this is happening ?

Regards

Nigel

Error: Cannot add a role assignment with empty role definition binding collection.

I extracted a template using web.GetProvisioningTemplate. The web use has some lists with broken permissions. The extracted template, when saved as xml, contains the correct security tag with role assignments. When I try to apply the template to a new web, I get an exception:

Cannot add a role assignment with empty role definition binding collection.

Sign the assembly

While it is entirely possible to get the source and sign the assembly locally, it would make it a lot easier (especially for just getting it via nuget) to have the assembly signed by default.

In the enterprise it is very common to require signed assemblies, and if you are using this in any kind of assembly that is required in on-prem inter-op with farm solutions, etc .. then there is a high likelihood that signed assemblies are needed.

Provisioning Engine: When setting default composed look, error 'Value cannot be null. Parameter name: masterPageServerRelativeUrl'

If you try to create a composed look that does not exist you get the error:

'The error message was 'Composed look 'MyLook' can not be found; pass null or empty to set look directly (not based on an existing entry)'

But, if you pass is null for the look name, a ArgumentNullException is thrown in BrandingExtensions.cs/SetMasterPagebyUrl (line 1057).

This appears to be caused by ObjectComposedLook.cs/ProvisionObjects line 55 where if the ColorFile, FontFile, and BackgroundFile is null or empty the code attempts to set the site back to the default composed look. Commenting out the Apply OOB theme call fixes the issue.

Q: What should the ideal behavior actually be?

Edit 2:
Looking at the logic in ObjectComposedLook/ProvisionObjects and I do not understand the rules being enforced in this code.

First, at the beginning of the method the rules applies the alternate CSS, then the site logo, but if color files, font file, and background file are all null or empty then the code tries to revert back to the default look. Wouldn't that undo CSS and/or logo changes already made?

Second, according to the code, the master page will only ever be set if the color file, font file, and background files are set since the call to set the master page URL is in the IF. Is the pattern here that we can only set the master page if we are setting the color, font, and background files? What if all I want to do is change the master page?

Installing solutions doesn't work

Hi,

I've posted this message previously in the PnP PowerShell tree but was advised to post it here instead.

Hi,

I'm trying to deploy a WSP to my Office 365 tenant using the PnP Powershell library. The manifest.xml file looks as follows:

<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/" SolutionId="7da4b965-0514-4e14-ae87-a75618ab3e56" SharePointProductVersion="15.0">
  <Assemblies>
    <Assembly Location="Intranet.dll" DeploymentTarget="GlobalAssemblyCache" />
  </Assemblies>
  <FeatureManifests>
    <FeatureManifest Location="Intranet_.Intranet.Core\Feature.xml" />
    <FeatureManifest Location="Intranet_.Intranet.NewsSlider\Feature.xml" />
  </FeatureManifests>
</Solution>

When I enter the command Install-SPOSolution -PackageId 7da4b965-0514-4e14-ae87-a75618ab3e56 -SourceFilePath 'Intranet.wsp' it returns the following error:

Install-SPOSolution : Invalid field name. {33e33eca-7712-4f3d-ab83-6848789fc9b6}  /sites/deptest/_catalogs/design
At line:1 char:1
+ Install-SPOSolution -PackageId 7da4b965-0514-4e14-ae87-a75618ab3e56 -SourceFileP ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Install-SPOSolution], ServerException
    + FullyQualifiedErrorId : EXCEPTION,OfficeDevPnP.PowerShell.Commands.InstallSolution

Where does the 33e33eca-7712-4f3d-ab83-6848789fc9b6 come from? I'm able to deploy the WSP successfully via the UI.

Updates:

I've tried installing different WSP's and on different site collections and get the same error with the same GUIDs.

Thanks for all the help

Bug provisioning pnp:DataRows

If you try to provisioning List items using pnp:DataRows node, you'll find that each item has custom security permissions, and are only visible to the user that did the provisioning.

This is because this If in ObjectListInstanceDataRows handler:

  if (dataRow.Security != null)
  {
    listitem.SetSecurity(parser, dataRow.Security);
  }

However, the dataRow.Security is never null, because the constructor is doing:

  if (security != null)
  {
    this.Security = security;
  }

and in the class, the Security property is always initialized as:

  private ObjectSecurity _objectSecurity = new ObjectSecurity();

I have a PR ready to publish that fixes this issue.

SetMasterPageByUrl Affects Sharepoint-Hosted Add-in Webs

BrandingExtensions.cs

If resetSubsitesToInherit is set to true when called on a web that contains SharePoint-Hosted add-ins, this function will apply a master page other than app.master to them, breaking them until the master page is set back manually or the add-in is reinstalled.

This blog post explains the issue with setting the master page for an add-in web.

Stub for the type with id "..." not found

I get an exception through web.Client.ExecuteQuery() when I try to extract a provision template with GetProvisioningTemplate. I diagnosed with a couple of extra ExecuteQuery here and there and the problem appears within ObjectContentType.cs GetEntities. At the start of the method I get no exception and at the end of the method I do get the exception. Maybe it is due the FieldLinks not loading properly?

The exact id in the exception is {1554af8c-7213-418c-a4a8-b06e7603c68a}.

I am using SharePoint server version 15.0.4569.1000.

SetDefaultColumnValues generates multiple A tags with same location in client_LocationBasedDefaults.html

I'm using the SetDefaultColumnValues extension method to set default metadata on some fields when provisioning sites using the Framework by invoking a custom provider which hooks in the provisioning process. However I see weird outcomes when setting default metadata on libraries. Some default values are not set as expected (few columns get default values, others not). After investigating I found out that something is messing up the anchortags in the client_LocationBasedDefaults.html form which is set up by the PnP extension method.

Example of XML outcome in client_LocationBasedDefaults.html:

<MetadataDefaults>
  <a href="/sites/PROJECT/SUBSITE/SUBSITE/LIBRARY">
    <DefaultValue FieldName="Field1">1;#Value1|38285471-58c3-47a7-88f1-78af509c2b17</DefaultValue>
    <DefaultValue FieldName="Field2">2;#Value2|a96363e7-7c7a-4070-b8d7-ad9fd4261d3e</DefaultValue>
    <DefaultValue FieldName="Field3">3;#Value3|27e1ed51-21fd-4892-9803-136a28bff8a0</DefaultValue>
  </a>
  <a href="/sites/PROJECT/SUBSITE/SUBSITE/LIBRARY">
    <DefaultValue FieldName="Field1">1;#Value1|38285471-58c3-47a7-88f1-78af509c2b17</DefaultValue>
    <DefaultValue FieldName="Field2">2;#Value2|a96363e7-7c7a-4070-b8d7-ad9fd4261d3e</DefaultValue>
  </a>
  <a href="/sites/PROJECT/SUBSITE/SUBSITE/LIBRARY">
    <DefaultValue FieldName="Field1">1;#Value1|38285471-58c3-47a7-88f1-78af509c2b17</DefaultValue>
    <DefaultValue FieldName="Field2">2;#Value2|a96363e7-7c7a-4070-b8d7-ad9fd4261d3e</DefaultValue>
    <DefaultValue FieldName="Field3">3;#Value3|27e1ed51-21fd-4892-9803-136a28bff8a0</DefaultValue>
  </a>
</MetadataDefaults>

The clue is that the path of all these default values is the same. According to the code in Core/OfficeDevPnP.Core/AppModelExtensions/ListExtensions.cs in the method SetDefaultColumnValuesImplementation (line 1015) the code is filling the xATag variable. But I see that this variable is in each iteration adding itself to the xMetadataDefaults element (line 1080). This should be done once per location iteration, instead of doing this every time. This line should be moved after line 1083 (note: Line numbers based on Dev branch). Tested this myself using a copy of the code and then the outcome looks like this:

<MetadataDefaults>
  <a href="/sites/PROJECT/SUBSITE/SUBSITE/LIBRARY">
    <DefaultValue FieldName="Field1">1;#Value1|38285471-58c3-47a7-88f1-78af509c2b17</DefaultValue>
    <DefaultValue FieldName="Field2">2;#Value2|a96363e7-7c7a-4070-b8d7-ad9fd4261d3e</DefaultValue>
    <DefaultValue FieldName="Field3">3;#Value3|27e1ed51-21fd-4892-9803-136a28bff8a0</DefaultValue>
  </a>
</MetadataDefaults>

I've tested this and this also gives the expected outcome. I compared this with the result when setting the values manually by using the UI. The outcome is exactly the same. Can this be fixed in the next release, such that the SetDefaultColumnValues method works as expected?

UserCustomAction ignores sequence on ScriptLink

When creating a CustomAction with location ScriptLink, the Sequence property is ignored.
Could you please change this?

The relevant code is located in AddCustomActionImplementation method in NavigationExtensions.cs.

Content Type ID "0x" is not supported

There is an issue in the current release of the provisioing engine with regard to the Content Type ID:
The current schema specifies that the Content Type ID has to have the pattern "0x[a-zA-Z0-9]+", however the Content Type ID "0x" is valid and denotes "System": https://msdn.microsoft.com/en-us/library/office/ms452896(v=office.14).aspx (SP 2010 documentation but this hasn't changed in SP2013). The List Instance Object Handler extracts the Content Types from the list and in some cases (if the fields are assigned to the list directly), writes the "0x" Content Type ID to the output file. This makes it impossible to reimport the output file, because the Content Type ID "0x" does not match the pattern specified in the schema and therefore, a validation error occurs.

In my opinion, there are two possible fixes:

  • Change the schema to allow the "System" Content Type ID ("0x")
  • Change the export so that the "System" Content Type is ommited from the output

I implemented the second one to fix the issue we are currently having, but I am not sure if this is the best approach and if this might cause some side effects.

Provisioning Engine does not create groups in sub sites

In ObjectSiteSecurity.cs there is an explicit check for if the current site is a sub site or the root web and if its a sub site to not apply any of the settings defined in the section. Why is this? If a sub site isn't inheriting permissions then there shouldn't be an exclusion from creating groups for that site.

    public override bool WillProvision(Web web, ProvisioningTemplate template)
    {
        if (!_willProvision.HasValue)
        {
            _willProvision = (template.Security.AdditionalAdministrators.Any() ||
                template.Security.AdditionalMembers.Any() ||
                template.Security.AdditionalOwners.Any() ||
                template.Security.AdditionalVisitors.Any() ||
                template.Security.SiteGroups.Any()) &&
                !web.IsSubSite();
        }

        return _willProvision.Value;

    }

Support for default pagelayout setting with value "__inherit"

When trying to export a subsite with GetProvisioningTemplate, this results in an exception XmlException: Data at root level is invalid.

var defaultLayoutXml = web.GetPropertyBagValueString(DEFAULTPAGELAYOUT, null);

results in the value __inherit.
And then

defaultPageLayoutUrl = XElement.Parse(defaultLayoutXml).Attribute("url").Value;

results in this exception.

Using assembly version 1.7.1015.1 of OfficeDevPnp.Core and SharePoint Server 2013 version 15.0.4753.1000.

Add DeleteAllGlobalNavigationNodes method to Core component as web extension

Good suggestion from Yammer group to make things slightly simpler: https://www.yammer.com/itpronetwork/#/Threads/show?threadId=567671742

"Using the Office Dev PnP we provision Team sites. We want to build up navigation from scratch, both the Global Navigation and Current Navigation. I'm using the Web.DeleteAllQuickLaunchNodes, to delete all Current Navigation nodes. To delete the Global Navigation nodes, I'm calling the web.DeleteNavigationNode method for each navigation node.
Is there a method, or can this be added, to delete all Global Navigation Nodes in a single call, something like Web.DeleteAllGlobalNavigationNodes?"

AddFieldToContentType is case sensitive

I just ran into the following error again:

Apply-SPOProvisioningTemplate : The property or field 'Id' has not been initialized. It has not been requested or the request has
not been executed. It may need to be explicitly requested.

This time I figured out what the problem is.

In my content type I included my custom field:
<pnp:FieldRef ID="CBF538FB-8b07-46A1-BC58-5B4779C23AA5" Name="Price" />

rather than:

<pnp:FieldRef ID="cbf538fb-8b07-46a1-bc58-5b4779c23aa5" Name="Price" />

Looking at the code in the core project I found lines like:

var existingCT = existingCTs.FirstOrDefault(c => c.StringId.Equals(ct.Id, StringComparison.OrdinalIgnoreCase));

The above does make the comparison case insensitive. Which is great when you develop the template xml files manually.

There are however also areas where the following case sensitive comparison is used and therefore a field may not be recognised.

var flink = contentType.FieldLinks.FirstOrDefault(fld => fld.Id == field.Id);

Get-SPOProvisioningTemplate ComposedLook

Hi

When I export site with Get-SPOProvisioningTemplate I'm getting an xml with the following included:

< pnp:ComposedLook Name="Office" ColorFile="" FontFile="" BackgroundFile="" MasterPage="{masterpagecatalog}/seattle.master" SiteLogo="{site}Style%20Library{site}bluesource{site}logo_block.png" AlternateCSS="{site}Style Library{site}bluesource{site}bluesource.css" Version="0" />

all the {site} should be replaced with '/'

When applying the template with the above line Apply-SPOProvisioningTemplate will generate an error.

After correcting the line to the following all works fine.

< pnp:ComposedLook Name="Office" ColorFile="" FontFile="" BackgroundFile="" MasterPage="{masterpagecatalog}/seattle.master" SiteLogo="/Style%20Library/bluesource/logo_block.png" AlternateCSS="/Style Library/bluesource/bluesource.css" Version="0" />

Provisioning Engine: Referencing a Field in a Content Type results in an error

Similiar issue to #72

The error has occured with Taxonomy Fields, Choice Fields and Calculated Fields, so I think it's a general issue for all FieldRefs in Content Types.

Yammer thread: https://www.yammer.com/itpronetwork/#/Threads/show?threadId=594295724

I'm getting the following error:
Apply-SPOProvisioningTemplate : The property or field 'Id' has not been initialized. It has not been requested or the request has
not been executed. It may need to be explicitly requested.
At line:1 char:1

  • Apply-SPOProvisioningTemplate .\template.xml -Verbose
  • - CategoryInfo          : WriteError: (:) [Apply-SPOProvisioningTemplate], PropertyOrFieldNotInitializedException
    - FullyQualifiedErrorId : EXCEPTION,OfficeDevPnP.PowerShell.Commands.Branding.ApplyProvisioningTemplate
    

SetDefaultColumnValues sets SPEventReceiver with wrong Synchronization property

When using SetDefaultColumnValues this gives issue when working with folders or document sets. On document sets and folders my default values are not set when uploading a new document, while it works when doing it directly on the library. So I started to configure it on a plain site without using PnP Provisioning and performing the configuration manually. Then I found out that there is a difference in the configuration of the LocationBasedMetadataDefaultsReceiver ItemAdded eventreceiver. On the PnP configured site the Synchronization property is set to DefaultSynchronization in code, which results in Asynchronous on my library:
image

I compared this value with the value of the library which has been manually configured and found out that this one is set to Synchronous:
image

After setting the eventreceivers on the other list as well to Synchronous my issue with default values on document sets and folders has been disappeared. Can this be changed in the code such that the eventreceiver works the same as when configuring the default values using the UI?

Content Type column order incorrect

When using the Provisioning engine, it is possible that the column order of a provisioned Content Type is wrong.
If a Content Type (CT-B) extends a different Content Type (CT-A), the Provisioning Engine creates CT-A first. Afterwards, it creates CT-B that referecnes CT-A. Because of this parent-child-relationship, all columns from CT-A are immediately present in CT-B in the order that is specified in CT-A. While adding the columns to CT-B, the engine skips the columns already present and only adds the columns that are unique to CT-B. These columns will be added after the already created columns.

How to change deployment location of files(css, images, etc.)

Hi,
I didn't find a solution how deploy files other than to copy them first to /bin folder and then remote provisioning engine just pick them up from there.
Is there any way how to tell the provisioning engine to look the files elsewhere, for example directly from where they are stored in Visual Studio solution?

Thanks

List already exists exception when executing ApplyProvisioningTemplate

When executing ApplyProvisioningTemplate; ObjectListInstance.cs throws a "List already exists" exception, whereas the function should check for duplicates. It appears there is already a document library with the same title, whereas the function now only checks for duplicates in the list name. By the way, the exception is currently not very useful as it is not stated which list is the cause.
I am using assembly version 1.7.1015.1 of OfficeDevPnP.Core.

Exception details:

Microsoft.SharePoint.Client.ServerException was unhandled
  _HResult=-2146233088
  _message=Er bestaat al een lijst, enquête, discussiebord of documentbibliotheek met de opgegeven titel in deze website. Kies een andere titel.
  HResult=-2146233088
  IsTransient=false
  Message=Er bestaat al een lijst, enquête, discussiebord of documentbibliotheek met de opgegeven titel in deze website. Kies een andere titel.
  Source=Microsoft.SharePoint.Client.Runtime
  ServerErrorCode=-2130575342
  ServerErrorTraceCorrelationId=d7f73d9d-2d5b-004a-345e-8d3712ae2e14
  ServerErrorTypeName=Microsoft.SharePoint.SPException
  ServerStackTrace=   at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
   at Microsoft.SharePoint.Library.SPRequest.CreateList(String bstrWebUrl, String bstrTitle, String bstrDescription, String bstrListUrl, String bstrFeatureId, Int32 lTemplateID, String bstrDocTemplateType, ListQuickLaunchOptions qlOpt, Boolean bProvisionViewsAndForms, ISPEnableModuleCallback pListInstanceModuleCallback, String bstrListInstanceSolutionInfo, String bstrListInstanceFeaturePath, String bstrListInstanceFeatureId, String bstrCustomSchemaXml, ISPEnableModuleCallback pListTemplateModuleCallback, String bstrListTemplateSolutionInfo)
   at Microsoft.SharePoint.SPListCollection.CreateList(String strTitle, String strDescription, String strListUrl, String strFeatureId, Int32 templateID, String strDocTemplateType, String strDataSource, String customSchemaXml, SPFeatureDefinition listInstanceFeatureDefintion, QuickLaunchOptions qlOpt, CreateFlags flags)
   at Microsoft.SharePoint.SPListCollection.Add(String title, String description, String url, String featureId, Int32 templateType, String docTemplateType, String customSchemaXml, SPFeatureDefinition listInstanceFeatureDefintion, QuickLaunchOptions quickLaunchOptions)
   at Microsoft.SharePoint.SPListCollection.Add_Client(SPListCreationInformation parameters)
   at Microsoft.SharePoint.ServerStub.SPListCollectionServerStub.InvokeMethod(Object target, String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)
   at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)
   at Microsoft.SharePoint.Client.ClientMethodsProcessor.InvokeMethod(Object obj, String methodName, XmlNodeList xmlargs, Boolean& isVoid)
   at Microsoft.SharePoint.Client.ClientMethodsProcessor.GetObjectFromObjectPath(XmlElement xe)
   at Microsoft.SharePoint.Client.ClientMethodsProcessor.GetObjectFromObjectPathId(String objectPathId)
   at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessInstantiateObjectPath(XmlElement xe)
   at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessOne(XmlElement xe)
   at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessStatements(XmlNode xe)
   at Microsoft.SharePoint.Client.ClientMethodsProcessor.Process()
  StackTrace:
       at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
       at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
       at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
       at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
       at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
       at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
       at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\ClientContextExtensions.cs:line 54
       at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryRetry(ClientRuntimeContext clientContext, Int32 retryCount, Int32 delay) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\ClientContextExtensions.cs:line 36
       at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.CreateList(Web web, ListInstance list, TokenParser parser, PnPMonitoredScope scope) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\Framework\Provisioning\ObjectHandlers\ObjectListInstance.cs:line 742
       at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\Framework\Provisioning\ObjectHandlers\ObjectListInstance.cs:line 85
       at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\Framework\Provisioning\ObjectHandlers\SiteToTemplateConversion.cs:line 181
       at Microsoft.SharePoint.Client.WebExtensions.ApplyProvisioningTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation applyingInformation) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\WebExtensions.cs:line 1031
       at Provisioning.Framework.Program.ApplyProvisioningTemplate(ConsoleColor defaultForeground, String webUrl, String userName, SecureString pwd) in ...\PnP\Samples\Provisioning.Framework.Console\Provisioning.Framework.Console\Program.cs:line 128
       at Provisioning.Framework.Program.Main(String[] args) in ...\PnP\Samples\Provisioning.Framework.Console\Provisioning.Framework.Console\Program.cs:line 36
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ObjectListInstance.ProvisionObjects(Web web, ProvisioningTemplate template, TokenParser parser, ProvisioningTemplateApplyingInformation applyingInformation) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\Framework\Provisioning\ObjectHandlers\ObjectListInstance.cs:line 85
       at OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.SiteToTemplateConversion.ApplyRemoteTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation provisioningInfo) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\Framework\Provisioning\ObjectHandlers\SiteToTemplateConversion.cs:line 181
       at Microsoft.SharePoint.Client.WebExtensions.ApplyProvisioningTemplate(Web web, ProvisioningTemplate template, ProvisioningTemplateApplyingInformation applyingInformation) in ...\PnP-Sites-Core\Core\OfficeDevPnP.Core\AppModelExtensions\WebExtensions.cs:line 1031
       at Provisioning.Framework.Program.ApplyProvisioningTemplate(ConsoleColor defaultForeground, String webUrl, String userName, SecureString pwd) in ...\PnP\Samples\Provisioning.Framework.Console\Provisioning.Framework.Console\Program.cs:line 128
       at Provisioning.Framework.Program.Main(String[] args) in ...\PnP\Samples\Provisioning.Framework.Console\Provisioning.Framework.Console\Program.cs:line 36
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

ListInstance object handler doesn't update Versioning settings on default Pages library

If you set a ListInstance node in the template XML pointing to the Default Pages library (publishing), some versioning features are not updated. This is because in the UpdateList method, it does:

if (existingList.BaseTemplate == (int)ListTemplateType.DocumentLibrary)

However, Page lib BaseTemplate is 850, and not 101.

I think it could be fixed changing the If as:

if (existingList.BaseType == BaseType.DocumentLibrary)

I've tested it with the Pages library and works fine. Not sure if I'm missing other scenarios.
I'm going to do a new PR to fix it that way, and see what the PnP team say.

Fields and View with localized sites

We have an issue where we export a Task list from a Project site, created in Swedish. When we try to apply the template to another Swedish site we get an error saying the column "Description" does not exist. If we rename the field link for the Calendar view of the Task list from Description to Beskrivning (Swedish) it all works as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.