pnp / pnp/pnpframework

[BUG] KeepPageCreationModificationInformation will throw error in ConvertTo-PnPPage

Open
#424 0 comments 0 reactions 1 assignee View on GitHub

@jansenbe is already working on this.

Since Jul 23, 2021.

area: page transformation 🦾 question
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

  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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.