[BUG] Separate page section backgrounds reset by Add-PnPPageSection and Add-PnPPageWebPart
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 904
- Forks
- 407
- Avg merge
- 9h 16m
- Merged PRs (30d)
- 10
Description
Issue
Section backgrounds are reset when updating a page with Add-PnPPageSection or Add-PnPPageWebPart and probably other commands.
Only the new section backgrounds are affected (i.e. not emphasis 0, 1, 2, 3 but rather the additional new ones that have gradiants images etc)
Expected behavior
Expecting Add-PnPPageSection, Add-PnPPageWebPart and other similar commands to not change separate sections on the page
Actual behavior
All section backgrounds that use the new backgrounds are reset on the page.
| Before | After |
|---|---|
Steps to reproduce behavior
- Create a page on a site using the UI
- Add a couple of sections.
- Change the section backgrounds to use the new ones (gradients etc)
- Publish the page
- Run commands to update the page. For example
$site = "Your_site_url"
$pageName = "Page_name"
Connect-PnpOnline $site
$page = Get-PnPPage -Identity $pageName
Add-PnPPageSection -Page $page -Order "0" -SectionTemplate "OneColumn"
- Reload the page in the browser. Note that all the new section background are gone
Note that the issue can also be reproduced with Add-PnPPageWebPart
What is the version of the Cmdlet module you are running?
2.5.0
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Add-PnPPageSection and Add-PnPPageWebPart entry points and reproduce the issue using the commands and page setup described. Trace how updating a page serializes its sections; done means adding a section or web part preserves existing new section backgrounds, including gradients and images.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100