pnp / modernization

All modernization tooling and guidance
http://aka.ms/sppnp-modernize
MIT License
157 stars 86 forks source link

Error when converting onPrem publishing pages to SPO: The given key 'Content' was not present in the dictionary. #644

Closed archishti closed 2 years ago

archishti commented 2 years ago

Hi, I have been able to use ConvertTo-PnPPage successfully when converting publishing pages that have just content & links. However I am getting error when trying the same command on publishing pages that have images as well (unsure if it is because of images). The error is bit generic and I am unable to figure it out. Any help or pointer will help greatly. (PS: pages are within the same Pages library)

Source: SP2016 Destination: SPO

Module Version: PnP.PowerShell v1.11.0

Command: $sp16Conn = Connect-PnPOnline https://intranet.local -Credentials (Get-Credential) -ReturnConnection -TransformationOnPrem $spOnlineConn = Connect-PnPOnline https://myorg.sharepoint.com/sites/intranet-dev -Interactive -ReturnConnection

ConvertTo-PnPPage -Identity "publishingpagesample.aspx" -PublishingPage -TargetConnection $spOnlineConn -Connection $sp16Conn -Overwrite -KeepPageCreationModificationInformation -LogType Console -PostAsNews (different combination of switches tried i.e ignore creation modification info, ignore permissions etc)

Error:

[Article page handling] Splitting images and videos from wiki text - as modern text web part does not support embedded images and videos Error: [Summary] A critical error occurred - transformation did not complete Error: The given key 'Content' was not present in the dictionary. StackTrace: at System.Collections.Generic.Dictionary2.get_Item(TKey key) at PnP.Framework.Modernization.Transform.WikiHtmlTransformator.TransformPlusSplit(List1 wikiPageWebParts, Boolean handleWikiImagesAndVideos, Boolean addTableListImageAsImageWebPart) at PnP.Framework.Modernization.Publishing.PublishingPageTransformator.Transform(PublishingPageTransformationInformation publishingPageTransformationInformation)

Any help is greatly appreciated.

archishti commented 2 years ago

This is due to FixedWebpart definition containing webparts from source page layouts. Once I removed this, the issue went away. Closing this issue