Saving a page via PnP leads to duplicates of inline image webparts
See original GitHub issueCategory
- Bug
Describe the bug
Microsoft recently added the ability, to add images inside a text webpart. Unfortunately PnP does not handle this new funcionality correctly.
I’ve created a new page with an image inside a text webpart. If I now load and save this page via PnP (without any modifications in between), the image appears twice on the page. The inline image is still in place inside the text webpart, but above the text webpart there is now an additional image webpart containing the same image. If I delete the added image webpart, also the inline image inside the text webpart disappears.
Steps to reproduce
- Create a new SitePage
- Add some text and an inline image to the existing text webpart
- Save the page via SharePoint UI
- Load and save the page without any modifications in between via PnP. Example code below (C#):
var context = await authProvider.GetContextAsync("https://mytenant.sharepoint.com/sites/testsite");
var page = context.Web.LoadClientSidePage("MyPage.aspx");
await page.SaveAsync();
Expected behavior
The page should not be modified at all, since we do not make any changes to it between loading and saving it via PnP. The image should not be duplicated.
Environment details (development & target environment)
- SDK version: PnP.Core 1.4.0, PnP.Core.Auth 1.4.0, PnP.Framework 1.7.0
- SDK used in: Azure Function, Console App
- Framework: .NET Core 3.1, .NET 5
- Tooling: Visual Studio 2022
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Duplicate the same web part containing multiple quick links ...
Up on the top bar click the plus + next to "New" then select "copy this page" allows you to make a complete...
Read more >Handling of inline images in text web part broken on export
I'm currently having the same issues adding inline images directly using PnP.PowerShell commands and having more or less the same issues.
Read more >Inline Image duplicated after reuploading SharePoint's ...
I have a SharePoint Text WebPart with an inline image in it. I want to perform changes on the page and re-upload my...
Read more >Working with modern client-side pages using PnP ...
We create a new view in the Document Library and set this as standard for the webpart, then run the above code one...
Read more >SharePoint Framework (SPFx) Samples
This is a sample SharePoint Framework client-side web part built using Angular, illustrating building multi-page web parts.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Works great on my end, thank you very much!
@jansenbe That’s great, thanks for the quick response and fix ☺