Skip to content

Template serializer changing "OneColumnVerticalSection" to "OneColumn" #1206

@PedroMordeP

Description

@PedroMordeP

I have an issue when using the following commands without doing anything else, just reading and saving, it converts my section type from "OneColumnVerticalSection" to "OneColumn" and leading to provisioning error of Index out off range when setting the web parts to the second column.

        $templateFilePath = "c:\PathToTemplate.xml"
 
        $mainTemplate = Read-PnPSiteTemplate -Path $templateFilePath
        Save-PnPSiteTemplate -Template $mainTemplate -Out $templateFilePath -Force

My template has a page with the following section.
This happens when I have the "CallToAction" web parts.
If I remove them, the Type remains as "OneColumnVerticalSection"

          <pnp:Section Order="1" Type="OneColumnVerticalSection" VerticalSectionEmphasis="Soft">
              <pnp:Controls>
                <pnp:CanvasControl WebPartType="CallToAction" JsonControlData="..." ControlId="df8e44e7-edd5-46d5-90da-aca1539313b8" Order="1" Column="1" />
                <pnp:CanvasControl WebPartType="CallToAction" JsonControlData="..." ControlId="df8e44e7-edd5-46d5-90da-aca1539313b8" Order="2" Column="1" />
                <pnp:CanvasControl WebPartType="CallToAction" JsonControlData="..." ControlId="df8e44e7-edd5-46d5-90da-aca1539313b8" Order="3" Column="1" />
                <pnp:CanvasControl WebPartType="Custom" JsonControlData="..." ControlId="7a8004cb-8a1d-4fee-831d-2780ba29554c" Order="1" Column="2" />
                <pnp:CanvasControl WebPartType="Custom" JsonControlData="..." ControlId="311d802e-8e1d-4c43-989a-92a8b321e207" Order="2" Column="2" />
                <pnp:CanvasControl WebPartType="Custom" JsonControlData="..." ControlId="0f654c60-160f-4f66-bc67-f693d244b447" Order="3" Column="2" />
              </pnp:Controls>
            </pnp:Section>

I tried to debug this and ended up in the ..PnP.Framework\src\lib\PnP.Framework\Provisioning\Providers\Xml\XmlPnPSchemaBaseSerializer.cs
But still can't understand where this change is being made

Image

Does someone have a clue why this happens and where?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions