pnp / pnp/powershell

[BUG] Separate page section backgrounds reset by Add-PnPPageSection and Add-PnPPageWebPart

Open
#4,086 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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
image image
Steps to reproduce behavior
  1. Create a page on a site using the UI
  2. Add a couple of sections.
  3. Change the section backgrounds to use the new ones (gradients etc)
  4. Publish the page
  5. 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"
  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.