Open LeoJiang1988 opened 5 years ago
Hi @LeoJiang1988,
So you only have the issue when you create the wiki page using the PnP AddWebPartToWikiPage method and then convert it. A manually created Wiki page in the UI does work fine. Is this correct?
Hi @jansenbe ,
Yes, correct.
why not change the CopyTo to MoveTo. Look like code use CopyTo for navigation, but code have fix navigation link function.
Best Regards!
Thx for the confirmation.
Once you use MoveTo SharePoint will also remove the navigation links that pointed to the page before the move. We use CopyTo and the whole approach in "swappages" to avoid losing these links.
Hi @LeoJiang1988,
I did some more checking and what I've noticed that SPO seems to close the web parts added via the AddWebPartToWikiPage method. This is something that used to work in the past.
As this is not an issue with page transformation I'm moving this issue to the PnP Sites core repository.
Also see #2048
Category [X ] Bug [ ] Enhancement
Environment [X ] Office 365 / SharePoint Online
First use PNP method AddWebPartToWikiPage add webpart to wiki page, then use API Transform wiki page to Modern page. After this step, the source wiki page will be blank.
Through the code, we found the mehtod AddWebPartToWikiPage use webpart.id in WikiField column value. But SharePoint UI add webpart use webpart storagekey.
The webpart.StorageKey only support in Server API.
The SwapPages method in PageTransformator.cs use File.Copyto will cause this issue.