[BUG] KeepPageCreationModificationInformation will throw error in ConvertTo-PnPPage #424
Labels
area: page transformation 🦾
Page transformation issue or pull request
question
Further information is requested
Problem Area
[x] Page Transformation: Error during the use of page transformation from PnP PowerShell
[ ] Page Transformation: Error during the use of page transformation from .Net
[ ] Page Transformation: Page is not looking correct after transformation
[ ] Modernization Scanner: something went wrong...
Expected or Desired Behavior
Using -KeepPageCreationModificationInformation will carry over the Created, Created By, Modified, and Modified By.
Observed Behavior
Using that flag will always return an error of:
The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
Steps to Reproduce
Run the following command:
ConvertTo-PnPPage -Identity $page.FieldValues.FileLeafRef -KeepPageCreationModificationInformation -Overwrite -TargetWebUrl $targetUrl -CopyPageMetadata -PublishingPage
Error Log
Message : The property or field 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.ListItem.GetFieldValue(String fieldName) at Microsoft.SharePoint.Client.ListItem.get_Item(String fieldName) at PnP.Framework.Modernization.Transform.BasePageTransformator.StoreSourcePageInformationToKeep(ListItem sourcePage) at PnP.Framework.Modernization.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation) at PnP.PowerShell.Commands.Pages.ConvertToClientSidePage.ExecuteCmdlet() in c:\PnPPowerShell\src\Commands\Pages\ConvertToPage.cs:line 388 at PnP.PowerShell.Commands.PnPSharePointCmdlet.ProcessRecord() in c:\PnPPowerShell\src\Commands\Base\PnPSharePointCmdlet.cs:line 60 ScriptLineNumber : 121
PnP.PowerShell version: 1.6.0
I am guessing this issue is similar to this previous issue:
#108
It worked fine previously, but now it always throws an error since around July 2021.
The text was updated successfully, but these errors were encountered: