powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[BUG] Export-PnPPage doesn't create info about the client side page if certain section backgrounds are used.

Open darktoasteroven opened this issue 8 months ago • 9 comments

Reporting an Issue or Missing Feature

If you use Export-PnPPage on a page that has a section background other than the first few very simple ones the exported xml file does not include a client side page object.

Expected behavior

When you run Export-PnPPage -Force -Identity $PageName -Out $migrationFileLocation -PersistBrandingFiles you should generate a file that includes all of the info to restore the page using Invoke-PnPSiteTemplate -Path $migrationFileLocation

Actual behavior

You get an xml file without the clientsidepage section

Image

Steps to reproduce behavior

Export-PnPPage -Force -Identity $PageName -Out $migrationFileLocation -PersistBrandingFiles

What is the version of the Cmdlet module you are running?

3.1.0

Which operating system/environment are you running PnP PowerShell on?

  • [X] Windows
  • [ ] Linux
  • [ ] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ ] Other : please specify

darktoasteroven avatar May 05 '25 12:05 darktoasteroven

I've just hit this too. Have you worked out what aspect of the background causes it?

AndyTukeatSoftcat avatar May 08 '25 16:05 AndyTukeatSoftcat

Having the same issue as well. Would appreciate if this can be fixed ASAP.

ranaictiu avatar May 19 '25 05:05 ranaictiu

I hate to be the one who moans about something that a lot of people do for free, but copying pages between sites is as pretty fundamental as you get for a SharePoint management tool. Why is this still an issue one PnP v3? I'm on a major project and this is causing loads of extra work. Sometimes it feels like developers for Microsoft get fixated on the new 'cool' stuff and forget about fixing the basics which are way more important to most people

AndyTukeatSoftcat avatar May 21 '25 07:05 AndyTukeatSoftcat

I hate to be the one who moans about something that a lot of people do for free, but copying pages between sites is as pretty fundamental as you get for a SharePoint management tool. Why is this still an issue one PnP v3? I'm on a major project and this is causing loads of extra work. Sometimes it feels like developers for Microsoft get fixated on the new 'cool' stuff and forget about fixing the basics which are way more important to most people

We are feeling SharePoint online gone downhill in last few years. I've been raised at least five tickets with Microsoft in last year or so, related to SharePoint. Been working with MS tech for nearly 20 years, I've not raised five tickets in first 19 years. PnP is always catching up with SharePoint deployments, Power Platform doesn't work properly with SharePoint, only 12 lookup columns supported, Form customisation nearly impossible (miss Nintext forms).

ranaictiu avatar May 21 '25 10:05 ranaictiu

We are feeling SharePoint online gone downhill in last few years. I've been raised at least five tickets with Microsoft in last year or so, related to SharePoint. Been working with MS tech for nearly 20 years, I've not raised five tickets in first 19 years. PnP is always catching up with SharePoint deployments, Power Platform doesn't work properly with SharePoint, only 12 lookup columns supported, Form customisation nearly impossible (miss Nintext forms).

Hello guys, I have the same issue. I ran into the same issue today. Trying to export the page with.

Export-PnPPage Home.aspx

It is returned empty until I remove the background from one section on the canvas. When the background is removed, the Page is correct. Now I can Invoke-PnPSiteTemplate to another site.

SteveJonasson avatar Jun 04 '25 13:06 SteveJonasson

Hello guys, I have the same issue. I ran into the same issue today. Trying to export the page with.

Export-PnPPage Home.aspx

It is returned empty until I remove the background from one section on the canvas. When the background is removed, the Page is correct. Now I can Invoke-PnPSiteTemplate to another site.

Thank you good sir! Same issue for me but your workaround was spot on.

From my end it appears any of the strong/solid colored backgrounds will work, but choosing any of the faded background will result in the page returning empty with Export-PnPPage.

I did not end up testing any uploaded background images.

Image

aaleksejev avatar Jun 05 '25 16:06 aaleksejev

Have just encountered this issue also - nearly SIX months, and no answer.

  1. I've checked the listItem properties - and the data within $i.FieldValues.CanvasContent1
  2. Compared against a page WITH the background - and WITHOUT
  3. There's a new section added "data-sp-webpartdata"
  4. This is a JSON-encoded section, related to 'zoneBackground'
  5. This is the bit that's causing issues - unclear WHY, as yet
Image

kachihro avatar Oct 03 '25 06:10 kachihro

Looking further into the code - it looks like the issue is probably within the FRAMEWORK ;

https://github.com/pnp/pnpframework/blob/692848047f334a6b231ab2d15baf53e44b7eb187/src/lib/PnP.Framework/Provisioning/ObjectHandlers/Utilities/ClientSidePageContentsHelper.cs

kachihro avatar Oct 03 '25 06:10 kachihro

Hello guys, I have the same issue. I ran into the same issue today. Trying to export the page with. Export-PnPPage Home.aspx It is returned empty until I remove the background from one section on the canvas. When the background is removed, the Page is correct. Now I can Invoke-PnPSiteTemplate to another site.

Thank you good sir! Same issue for me but your workaround was spot on.

From my end it appears any of the strong/solid colored backgrounds will work, but choosing any of the faded background will result in the page returning empty with Export-PnPPage.

I did not end up testing any uploaded background images.

Image

===============

The issue looks to be resolved - I used the latest DEV branch (in Visual Studio 2022) - and it works !

Also - I then tried the latest NIGHTLY build of PNP.PowerShell (3.1.172). And it works ! ✅

There have been a lot of changes over the last six months - since 3.1.0 was released.

  1. Check your version of PNP PowerShell ; Get-Module -Name PnP.PowerShell -ListAvailable | select Name, Version

  2. It will probably be 3.1.0

  3. Update to use the newer release (3.1.172)

  4. Uninstall first ; uninstall-Module -Name "PnP.PowerShell"

  5. Then the nightly build ; Install-Module PnP.PowerShell -AllowPrerelease -SkipPublisherCheck

HTH

kachihro avatar Oct 04 '25 05:10 kachihro