[BUG] KeepPageCreationModificationInformation will throw error in ConvertTo-PnPPage
@jansenbe is already working on this.
Since Jul 23, 2021.
- Dominant language
- C#
- Stars
- 259
- Forks
- 161
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
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:
https://github.com/pnp/pnpframework/issues/108
It worked fine previously, but now it always throws an error since around July 2021.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.