Pnp-sites-core: List View WebPart does not keep selected View when provisioned

Created on 21 Feb 2018  ·  7Comments  ·  Source: pnp/PnP-Sites-Core

_From @sivamsolai on February 16, 2018 10:8_

Hi Team

The list view part not maintaining selected view on Home page when provisioned. We added the calendar list view web part and “calendar” view is selected. But when provisioned not maintaining view.
Schema
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2018/01/ProvisioningSchema">

Web part
<pnp:WebPart Title="Calendar" Row="1" Column="1"> <pnp:Contents> <WebPart xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/WebPart/v2"> <Title>Calendar</Title> <FrameType>Default</FrameType> <Description /> <IsIncluded>true</IsIncluded> <ZoneID>wpz</ZoneID> <PartOrder>0</PartOrder> <FrameState>Normal</FrameState> <Height /> <Width /> <AllowRemove>true</AllowRemove> <AllowZoneChange>true</AllowZoneChange> <AllowMinimize>true</AllowMinimize> <AllowConnect>true</AllowConnect> <AllowEdit>true</AllowEdit> <AllowHide>true</AllowHide> <IsVisible>true</IsVisible> <DetailLink>{site}/Lists/Calendar</DetailLink> <HelpLink /> <HelpMode>Modeless</HelpMode> <Dir>Default</Dir> <PartImageSmall /> <MissingAssembly>Cannot import this Web Part.</MissingAssembly> <PartImageLarge>/_layouts/15/images/itevent.png?rev=40</PartImageLarge> <IsIncludedFilter /> <Assembly>Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly> <TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName> <WebId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">00000000-0000-0000-0000-000000000000</WebId> <ListViewXml xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">&lt;View Name="{0F3CBEC0-0E7B-4328-A060-B2FD0EA9B84F}" Type="CALENDAR" Hidden="TRUE" RecurrenceRowset="TRUE" DisplayName="" Url="{site}/SitePages/Home.aspx" Level="1" BaseViewID="2" ContentTypeID="0x" MobileUrl="_layouts/15/mobile/viewdaily.aspx" ImageUrl="/_layouts/15/images/events.png?rev=44"&gt;&lt;Toolbar Type="Standard" /&gt;&lt;ViewHeader /&gt;&lt;ViewBody /&gt;&lt;ViewFooter /&gt;&lt;ViewEmpty /&gt;&lt;ParameterBindings&gt;&lt;ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" /&gt;&lt;ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" /&gt;&lt;/ParameterBindings&gt;&lt;ViewFields&gt;&lt;FieldRef Name="EventDate" /&gt;&lt;FieldRef Name="EndDate" /&gt;&lt;FieldRef Name="fRecurrence" /&gt;&lt;FieldRef Name="EventType" /&gt;&lt;FieldRef Name="WorkspaceLink" /&gt;&lt;FieldRef Name="Title" /&gt;&lt;FieldRef Name="Location" /&gt;&lt;FieldRef Name="Description" /&gt;&lt;FieldRef Name="Workspace" /&gt;&lt;FieldRef Name="MasterSeriesItemID" /&gt;&lt;FieldRef Name="fAllDayEvent" /&gt;&lt;/ViewFields&gt;&lt;ViewData&gt;&lt;FieldRef Name="Title" Type="CalendarMonthTitle" /&gt;&lt;FieldRef Name="Title" Type="CalendarWeekTitle" /&gt;&lt;FieldRef Name="Location" Type="CalendarWeekLocation" /&gt;&lt;FieldRef Name="Title" Type="CalendarDayTitle" /&gt;&lt;FieldRef Name="Location" Type="CalendarDayLocation" /&gt;&lt;/ViewData&gt;&lt;Query&gt;&lt;Where&gt;&lt;DateRangesOverlap&gt;&lt;FieldRef Name="EventDate" /&gt;&lt;FieldRef Name="EndDate" /&gt;&lt;FieldRef Name="RecurrenceID" /&gt;&lt;Value Type="DateTime"&gt;&lt;Month /&gt;&lt;/Value&gt;&lt;/DateRangesOverlap&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;</ListViewXml> <ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">{{listid:Calendar}}</ListName> <ListId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">{listid:Calendar}</ListId> <ViewFlag xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">532493</ViewFlag> <ViewFlags xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">Html TabularView Hidden RecurrenceRowset Calendar</ViewFlags> <ViewContentTypeId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">0x</ViewContentTypeId> </WebPart> </pnp:Contents> </pnp:WebPart>

$templateFilename=Pnp-Feb-Demo.xml'

Apply-PnPProvisioningTemplate -path $templateFilename
Get-PnPProvisioningTemplate -Out $templateFilename

Expected behavior

image

Actual behavior

image

Steps to reproduce behavior

Please include complete code samples in-line or linked from gists

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [X ] PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

ModuleType Version Name -
Binary 2.23.18... SharePointPnPPowerShellOnline

How did you install the PnP-PowerShell Cmdlets?

  • [X ] MSI Installed downloaded from GitHub
  • [ ] Installed through the PowerShell Gallery with Install-Module
  • [ ] Other means

_Copied from original issue: SharePoint/PnP-PowerShell#1379_

Most helpful comment

Update, please!

All 7 comments

Hi Team
Could you please share the update on this

Is there an update on this?

No update?

Update, please!

same issue... SP2013 Onprem.
Fix please

Same issue (SharePoint online), such a shame!

Seem to go wrong already at extraction -> ListView "Calendar" en ListView "Completed" are extracted with names to lower case, in the template the views displayname are now "calendar" and "completed". There are multiple views created "Calendar" already is created based on the list TemplateType. The provisioning code is now created a second view with the name "calendar" in lowercase. This view is created as a view with type "HTML" and not as a view with type "CALENDAR".

Was this page helpful?
0 / 5 - 0 ratings