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

Calling Page Save() without modification results in ClientException #1601

Open
1 task done
SPWizard01 opened this issue Jan 28, 2025 · 0 comments
Open
1 task done
Labels
area: pages API 📄 Working with modern pages question Further information is requested

Comments

@SPWizard01
Copy link

Category

  • Bug

Describe the bug

When I call Save() method without any modification I get an error
Image

   at PnP.Core.Model.SharePoint.PageWebPart.ToHtml(Single controlIndex)
   at PnP.Core.Model.SharePoint.CanvasColumn.ToHtml()
   at PnP.Core.Model.SharePoint.CanvasSection.ToHtml()
   at PnP.Core.Model.SharePoint.Page.ToHtml()
   at PnP.Core.Model.SharePoint.Page.<SaveAsync>d__151.MoveNext()
   at PnP.Core.Model.SharePoint.Page.Save(String pageName)
   at Program.<<Main>$>d__0.MoveNext() in C:\P\PnPCoreTests\Program.cs:line 167

Steps to reproduce

    var pnpContextFactory = scope.ServiceProvider.GetRequiredService<IPnPContextFactory>();
    var context = await pnpContextFactory.CreateAsync(new Uri(siteUrl));
    var pg = context.Web.GetPages("Page With FullWidth Sections.aspx");
    var f = pg.First();
    f.Save();
    f.Publish();

Expected behavior

The page saves without error.

Environment details (development & target environment)

  • SDK version: 1.14.0
  • OS: Windows 11
  • SDK used in: Console App
  • Framework: .NET Core v9
  • Browser(s): Latest Chromium Edge
  • Tooling: Visual Studio 2022 Preview

Additional context

What I am trying to achieve is removing header from Communication Site page, works in UI but does not work in the code.

@jansenbe jansenbe added area: pages API 📄 Working with modern pages question Further information is requested labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: pages API 📄 Working with modern pages question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants