Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] KeepPageCreationModificationInformation will throw error in ConvertTo-PnPPage #424

Open
natpdeee opened this issue Jul 14, 2021 · 0 comments
Assignees
Labels
area: page transformation 🦾 Page transformation issue or pull request question Further information is requested

Comments

@natpdeee
Copy link

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.

@jansenbe jansenbe transferred this issue from pnp/modernization Jul 23, 2021
@jansenbe jansenbe self-assigned this Jul 23, 2021
@jansenbe jansenbe added area: page transformation 🦾 Page transformation issue or pull request question Further information is requested labels Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: page transformation 🦾 Page transformation issue or pull request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants