-
Notifications
You must be signed in to change notification settings - Fork 163
Description
Category
- Bug
Describe the bug
When extracting a ClientSidePage to provision on a different SharePoint site, the resulting ClientSidePage is different from the extracted one. Here is an image of the page I'm extracting:
And here is an image after the extracted page is provisioned on a different SharePoint site:
Problems:
The section containing a webpart is not collapsible.
The vertical section gets the same collapsible settings as the top section.
Steps to reproduce
- Create a client side page with a vertical section, and a collapsible section containing a webpart
- Extract the ClientSidePage provisioning template using
PnP.Framework ClientSidePageContentsHelper.ExtractClientSidePage(); - Apply the extracted provisioning template to a different sharepoint site.
Expected behavior
I am expecting the provisioned ClientSidePage to look the same as the extracted one. (See images above)
Environment details (development & target environment)
- SDK version: 1.8
- OS: Windows 10
- SDK used in: ASP.Net Web App
- Framework: .Net Framework 4.8
- Browser(s): Chrome v109
- Tooling: Visual Studio 2019
Additional context
I think the problem might be located in PageWebPart.cs. Here's a snippet of the code responsible for setting the section collapsible. Note that setting the Type = 1 renders the section as collapsible, as expected.
controlData.ZoneGroupMetadata = new SectionZoneGroupMetadata()
{
// Set section type to 1 if it was not set (when new sections are added via code)
Type = (Section as CanvasSection).SectionType,
DisplayName = Section.DisplayName,
IsExpanded = Section.IsExpanded,
ShowDividerLine = Section.ShowDividerLine,
};
In PageText.cs that same snippet of code reads like this. I suspect maybe the PageWebPart.cs code should be the same.
controlData.ZoneGroupMetadata = new SectionZoneGroupMetadata()
{
// Set section type to 1 if it was not set (when new sections are added via code)
Type = (Section as CanvasSection).SectionType == 0 ? 1 : (Section as CanvasSection).SectionType,
DisplayName = Section.DisplayName,
IsExpanded = Section.IsExpanded,
ShowDividerLine = Section.ShowDividerLine,
};
As for the issue with the vertical section taking the same collapsible settings as the first section, I think it should just not be possible to mark a vertical section as collapsible, since it's not possible in the editor. Checking if the section is a vertical section before setting ZoneGroupMetadata.

