ConvertTo-PnPPage IncludeVerticalColumns throws Index out of Range error
When trying to do a page modernization, ConvertTo-PnPPage throws an error when we specify IncludeVerticalColumn = true in the page layout mapping file. Header and Metadata tags have been removed from the sample below.
<PageLayout Name="SomePageLayout" AssociatedContentType="" PageLayoutTemplate="AutoDetect" IncludeVerticalColumn="true" PageHeader="Custom">
<SectionEmphasis VerticalColumnEmphasis="Soft">
</SectionEmphasis>
<WebParts>
<Field Name="PublishingPageContent" TargetWebPart="SharePointPnP.Modernization.WikiTextPart" Row="1" Column="1" Order="1">
<Property Name="Text" Type="string" />
</Field>
</WebParts>
<WebPartZones>
<WebPartZone ZoneIndex="0" ZoneId="BottomZone" Row="1" Column="1" />
</WebPartZones>
</PageLayout>
Error Message:

Command Run:
ConvertTo-PnPPage -RemoveEmptySectionsAndColumns:$false -Identity $page.FieldValues.FileLeafRef -TargetWebUrl $targetUrl -CopyPageMetadata -PageLayoutMapping "$($folderLocation)\$($mappingName)" -PublishingPage -ErrorAction Stop
Expected Outcome: The page modernization works and adds a blank vertical column to the page.
@natpdeee : can you try putting something in column 2 and see if that makes a difference? Below snippet just adds some text, so easy to use
<Field Name="ID" TargetWebPart="SharePointPnP.Modernization.WikiTextPart" Row="1" Column="2">
<Property Name="Text" Type="string" Functions="StaticString('<H1>This is some extra text</H1>')" />
</Field>
That will fix the problem.
My Pull Request 614 fixes that problem. In the PublishingLayoutTransformer Transform method the maxColumns is 0. Setting it to 1 fixes the problem