Pnpframework: RemoveExistingNodes is always set to false

Created on 10 Mar 2021  Â·  3Comments  Â·  Source: pnp/pnpframework

When trying to export with the added configuration, the RemoveExistingNodes attribute in StructuralNavigation is always set to false.
Both in GlobalNavigation and CurrentNavigation.

config.json

{
    "$schema": "https://aka.ms/sppnp-extract-configuration-schema",
    "handlers": [
        "Navigation"
    ],
    "navigation": {
        "removeExistingNodes": true
    }
}

Result of export

<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2020/02/ProvisioningSchema">
  <pnp:Preferences Generator="PnP.Framework, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null" />
  <pnp:Templates ID="CONTAINER-TEMPLATE-2FE9A08C961B4CA0AD2AC6133CD7420D">
    <pnp:ProvisioningTemplate ID="TEMPLATE-2FE9A08C961B4CA0AD2AC6133CD7420D" Version="1" BaseSiteTemplate="SITEPAGEPUBLISHING#0" Scope="RootSite">
      <pnp:Navigation AddNewPagesToNavigation="true" CreateFriendlyUrlsForNewPages="true">
        <pnp:GlobalNavigation NavigationType="Structural">
          <pnp:StructuralNavigation RemoveExistingNodes="false" />
        </pnp:GlobalNavigation>
        <pnp:CurrentNavigation NavigationType="StructuralLocal">
          <pnp:StructuralNavigation RemoveExistingNodes="false">
            <pnp:NavigationNode Title="Home" Url="{site}" />
            <pnp:NavigationNode Title="Dashboard" Url="{site}/Lists/Dashboard" />
          </pnp:StructuralNavigation>
        </pnp:CurrentNavigation>
      </pnp:Navigation>
    </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>
provisioning âš™ bug

Most helpful comment

I created a PR to fix the issue https://github.com/pnp/pnpframework/pull/300 . Basically the code would look for RemoveExistingNodes property in the json with uppercase R instead of the one defined in the schema removeExistingNodes .

All 3 comments

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

Any progress on this bug?

I created a PR to fix the issue https://github.com/pnp/pnpframework/pull/300 . Basically the code would look for RemoveExistingNodes property in the json with uppercase R instead of the one defined in the schema removeExistingNodes .

Was this page helpful?
0 / 5 - 0 ratings