modernization: Failed to modernize page, Index out of range error
Category
[ ] Bug
Problem Area
[ ] Page Transformation: Error during the use of page transformation from PnP PowerShell
Expected or Desired Behavior
The page should be transformed to modern normally.
Observed Behavior
Transformation failed and Index out of range exception is thrown
Steps to Reproduce
I’m using PnP version 3.13.19 and running the sample powershell script of pages transformation and just changing the site URL and it throws the below error on the attached homepage:
ConvertTo-PnPClientSidePage : Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
At C:\Users\gmohamed\source\repos\SharePointOnline-Migration-Tool\PowerShell
Scripts\ModernizationScripts\ModernizingPages.ps1:27 char:27
+ ... odernPage = ConvertTo-PnPClientSidePage -Identity $page.FieldValues[" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [ConvertTo-PnPClientSidePage], ArgumentOutOfRangeException
+ FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.ClientSidePages.ConvertToClientSidePage
Get-PnPException output:
Message : Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Stacktrace : at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument,
ExceptionResource resource)
at SharePointPnP.Modernization.Framework.Transform.ContentTransformator.LastColumnOrder(Int32
row, Int32 col)
at SharePointPnP.Modernization.Framework.Transform.ContentTransformator.Transform(List`1
webParts)
at SharePointPnP.Modernization.Framework.Transform.PageTransformator.Transform(PageTransformation
Information pageTransformationInformation)
at SharePointPnP.PowerShell.Commands.ClientSidePages.ConvertToClientSidePage.ExecuteCmdlet()
at SharePointPnP.PowerShell.Commands.PnPCmdlet.ProcessRecord()
ScriptLineNumber : 27
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (11 by maintainers)
Commits related to this issue
- Improved wiki page layout detection, ensure we always return a layout type with the correct amount of column to avoid index errors #304 — committed to pnp/modernization by jansenbe 5 years ago
Hi @jansenbe Sorry for the late reply, I got busy throughout the last couple of days in work.