Open mmi-wp opened 1 year ago
@mmi-wp : this feels like an issue with exporting the page to a template or with applying the template. When you inspect the extracted template is then everything configured correctly?
@jansenbe as far as I can tell, everything is correct in the extracted template. When applying the template, the generated html and/or the sp-controldata JSON is not correct for a collapsible section. Further, the code does not seem to distinguish between "regular" sections and vertical section content.
I don't see any reason for the code to be different between PageWebPart.cs and PageText.cs
@jansenbe We are still having this issue.
I don't understand why this is tagged as a question, when I filed it as a bug report. I also don't understand why it was moved from pnpcore to pnpframework, when the bug I'm describing seems to stem from pnpcore.
@jansenbe Any update on this?
Category
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
PnP.Framework ClientSidePageContentsHelper.ExtractClientSidePage();
Expected behavior
I am expecting the provisioned ClientSidePage to look the same as the extracted one. (See images above)
Environment details (development & target environment)
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.
In PageText.cs that same snippet of code reads like this. I suspect maybe the PageWebPart.cs code should be the same.
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.