PnP-Provisioning-Schema icon indicating copy to clipboard operation
PnP-Provisioning-Schema copied to clipboard

QuickLaunch navigation nodes get removed after updating lists

Open cleferman opened this issue 2 years ago • 1 comments

I have a similar quick launch navigation structure as in the picture below: image

The Templates node points to a document library. It's url is {site}/Templates/Forms/AllItems.aspx.

Because I'm using the pnp provisioning engine to add and update artefacts in SharePoint Online, I have a provisioning template which adds or updates the Templates list.

<pnp:ProvisioningTemplate ID="Templates" xmlns:pnp="http://schemas.dev.office.com/PnP/2021/03/ProvisioningSchema">
	<pnp:Lists>
		<pnp:ListInstance
			Title="{resource:Library_Templates}"
			TemplateType="101"
			Url="Templates"
			EnableFolderCreation="false"
			EnableVersioning="true"
			EnableMinorVersions="false"
			MaxVersionLimit="50000"
			
			EnableAttachments="false"
			ContentTypesEnabled="true"
			RemoveExistingContentTypes="true"> 
			<pnp:ContentTypeBindings>
				<pnp:ContentTypeBinding ContentTypeID="0x01010047421319F25441D68B1E7B7AB3295A19" Default="true"/>
				<pnp:ContentTypeBinding ContentTypeID="0x010100D549991D99554EAAA3E78A78A20B2E10" Default="false"/>
				<pnp:ContentTypeBinding ContentTypeID="0x010100EA56B56D1E12482EB3C61338422E840C" Default="false"/>
				<pnp:ContentTypeBinding ContentTypeID="0x0120D520009DF7A4C82FA0454C8C365CA8F2CEF730" Default="false"/>
				<pnp:ContentTypeBinding ContentTypeID="0x0120D520000F3F1D8533A6469CBDB20D4DD43333CD" Default="false"/>
				<pnp:ContentTypeBinding ContentTypeID="0x0120D520000AA15DCEEA0848C491D84C94E96ABF39" Default="false"/>
			</pnp:ContentTypeBindings>
			<pnp:Views RemoveExistingViews="false">
				<View
					Name="All Documents"
					DefaultView="TRUE"
					MobileView="TRUE"
					MobileDefaultView="TRUE"
					Type="HTML"
					DisplayName="All Documents"
					Url="{site}/Templates/Forms/AllItems.aspx">
					<ViewFields>
						<FieldRef Name="DocIcon"/>
						<FieldRef Name="LinkFilename"/>
						<FieldRef Name="Title"/>
						<FieldRef Name="Modified"/>
						<FieldRef Name="Editor"/>
					</ViewFields>
				</View>
			</pnp:Views>
		</pnp:ListInstance>
	</pnp:Lists>
</pnp:ProvisioningTemplate>

As soon as I apply this provisioning template, my Templates navigation node will disappear.

Is there any reason why updating a list will remove the navigation node pointing to it? Is there any way to prevent that from happening? Imagine having 15 navigation nodes grouped under a navigation header all with audience targeting. These nodes will disappear as soon as I apply an update to the site and it will be time consuming to built everything back up since audience targeting is not supported in the schema.

cleferman avatar Jan 04 '23 19:01 cleferman

Does anybody have a solution for this. I am also facing this issue sometimes but not every time using PnP PowerShell 1.12.0. Thank you in advance for any suggestions to fix this.

webdevelperify avatar Apr 27 '23 19:04 webdevelperify