pnp / pnp/pnpframework

Invoke-PnPSiteTemplate throw error: "Index was outside the bounds of the array" with DefaultColumnValue on Folder in template

Open
#940 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

When provisioning a list whit folder and applying a DefaultColumnValue, in this case on a Choice column the provisioning fails with the error "Index was outside the bounds of the array".

                               <pnp:DefaultColumnValues>
                                 <pnp:DefaultColumnValue Key="DocumentType" Value="a Contract" />
                               </pnp:DefaultColumnValues>
               <pnp:Properties>
                 <pnp:Property Key="Title" Value="" />
               </pnp:Properties>
             </pnp:Folder>```

Invoke-PnpsiteTemplate -Path ./30-lists-Contract-Excluding-Financial-Details.xml
Error: Invoke-PnPSiteTemplate: Index was outside the bounds of the array.
Message          : Index was outside the bounds of the array.
Stacktrace       :    at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in
                  c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 101
                     at System.Management.Automation.CommandProcessor.ProcessRecord()
ScriptLineNumber : 1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with Invoke-PnPSiteTemplate using 30-lists-Contract-Excluding-Financial-Details.xml and the shown Folder DefaultColumnValue. Start at PnPConnectedCmdlet.cs:101 and trace the provisioning-engine handling of the folder and choice column. Done means the template provisions successfully without the array-bounds error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.