question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] KeepPageCreationModificationInformation switch causing error on publishingpage transformation using ConvertTo-PnPClientSidePage

See original GitHub issue

Thank you for reporting a bug. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. Thanks!

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

Published news article hosted in classic site in SharePoint online converted to client side page in communication site on same tenant using the KeepPageCreationModificationInformation switch to maintain the original author, editor, created and modified information.

Observed Behavior

command failed with the error 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.   at Microsoft.SharePoint.Client.ListItem.GetFieldValue(String fieldName)
   at SharePointPnP.Modernization.Framework.Transform.BasePageTransformator.StoreSourcePageInformationToKeep(ListItem sourcePage)
   at SharePointPnP.Modernization.Framework.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)_ 

When the KeepPageCreationModificationInformation switch is removed the page is converted successfully but the author and editor information is not migrated which is causing us a problem.

Steps to Reproduce

ConvertTo-PnPClientSidePage `
-Identity '************page.aspx' `
-PublishingPage `
-KeepPageCreationModificationInformation `
-PostAsNews `
-Overwrite `
-LogVerbose -LogType File -LogFolder c:\temp\Logs `
-TargetWebUrl https://***************.sharepoint.com/sites/news01 `
-PageLayoutMapping 'C:\Temp\custompagelayoutmapping.xml'

SharePointPnPPowerShellOnline version

3.26.2010.0

Modernization Summary Report

Date Duration Source Page Target Page Url Status
26/11/2020 13:03:14 00:00:01 A issue prevented successful transformation

Critical Errors during transformation

26/11/2020 13:03:16 -

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. at Microsoft.SharePoint.Client.ListItem.GetFieldValue(String fieldName) at SharePointPnP.Modernization.Framework.Transform.BasePageTransformator.StoreSourcePageInformationToKeep(ListItem sourcePage) at SharePointPnP.Modernization.Framework.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)

Individual Page details

Transformation Details:

  • Report date: 26/11/2020 13:03:14
  • Transform duration: 00:00:01
  • Transforming from site: https://***.sharepoint.com/news
  • Cross-Site transfer mode to site: https://***.com/sites/News01
  • A critical error occurred - transformation did not complete

Page Transformation Settings

Property Setting
Engine version 1.0.2010.0
Overwrite True
Target Page Name
Target Page Folder
Target Page Folder Overrides Default Folder False
Keep Page Specific Permissions True
Remove Empty Sections And Columns True
Handle Wiki Images And Videos True
Add Table List Image As Image Web Part True
Keep Page Creation Modification Information True
Publish Created Page True
Post As News True
Disable Page Comments False
Skip Url Rewrite False
Skip Default Url Rewrite False
Url Mapping File
Term Mapping File
Skip Term Store Mapping False
Skip User Mapping False
User Mapping File
L D A P Connection String
Skip Telemetry False

Transformation Operation Details

Date Operation Actions Performed
26/11/2020 13:03:15 Input Validation Validation checks complete
26/11/2020 13:03:15 SharePoint Connection Loading client context objects
26/11/2020 13:03:15 SharePoint Connection Loading target client context object

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
jansenbecommented, Jan 22, 2021

@phil-maynard : we’ve moved this code base into PnP Framework and will maintain it from there on. There will be no new “classic” PnP PowerShell releases anymore, so the only way to possibly fix this is by reproducing this in PnP Framework and the new PowerShell. I’ll move this issue over to that repo for that reason.

@TuomasPakkanen : please create a new issue in PnP Framework to track your modernization feature ask. We do plan to rewrite the page transformation engine, so we can track that requirement when we start on that effort

1reaction
jansenbecommented, Jan 22, 2021

@phil-maynard : would it be possible to debug this from your side? When using the latest PnP Framework nuget package you can use our sourcelink support to easily debug this without having to pull down and build the source code. See https://pnp.github.io/pnpcore/using-the-sdk/basics-debug.html on how to configure visual studio to use sourcelink. See https://github.com/pnp/pnpframework/blob/dev/src/lib/PnP.Framework.Modernization.Test/Transform/Publishing/PublishingPageTests.cs#L38 as sample snippet doing a publishing page transformation from code

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] KeepPageCreationModificationInformation switch ...
[BUG] KeepPageCreationModificationInformation switch causing error on publishingpage transformation using ConvertTo-PnPClientSidePage #108.
Read more >
Transforming to modern site pages using PowerShell
Explains how to transform classic wiki and web part pages into modern pages using the SharePoint PowerShell.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found