pnp / pnp/pnpframework

Duplicated BaseViewId in Events list after applied PnP Site Template

Open
#463 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
259
Forks
161
Avg merge
10h 33m
Merged PRs (30d)
1

Description

BEFOFRE apply a PnP template:

get-pnpview -List E9E6AC62-B573-4972-AD89-8900F6CF9D89 |fl Title,Id,base

Title : Calendar
Id : b6193ae5-07c9-4274-abf0-7c88678b1ab8
BaseViewId : 2

Title : All Events
Id : 1f5c97d3-bdd5-458b-8a79-5907db57e5ca
BaseViewId : 1

Title : Current Events
Id : 68d0c3f9-34dc-4f87-9a4c-b13019febc8e
BaseViewId : 3

AFTER applied a PnP site template with Events list:

get-pnpview -List E9E6AC62-B573-4972-AD89-8900F6CF9D89 |fl Title,Id,base

Title : Calendar
Id : c8719b93-b5aa-4559-9773-13b269925094
BaseViewId : 1

Title : All Events
Id : 28745d11-8c07-43ca-b48c-4c7659df5b93
BaseViewId : 1

Title : Current Events
Id : adb3ce50-51ba-457a-95c4-6922b6bac54e
BaseViewId : 1

This causes Events Webpart not showing category issue (https://answers.microsoft.com/en-us/msoffice/forum/all/sharepoint-online-events-web-part-not-showing/6a3da84a-bc97-4340-bd41-e233459a043a). After applied PnP site template, all views' BaseViewIds equal to 1.

image

Because all views' BaseViewIds equal to 1, first GetById api call returns a wrong view (Calendar view) and then RenderListFilterData in second GetById api call returns nothing (0 byte). Then javascript line 5110 throws errror and cannot render a list of category choices.

Seems it relates to
https://github.com/pnp/pnpframework/blob/39d966e09c30db771aca2fafbf702fc82a498597/src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs
image

When create SPView with viewType = 524288 (ViewType.Calendar), Calendar view's BaseViewId is 2. When create SPView with viewType = 524288+8193 (ViewType.Calendar | ViewType.Recurrence) , Calendar view's BaseViewId is 1 and causes above category issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/lib/PnP.Framework/Provisioning/ObjectHandlers/ObjectListInstance.cs and inspect how the Events list creates SPView objects for ViewType.Calendar and ViewType.Recurrence. Reproduce the provisioning case, compare the resulting BaseViewId values with the reported views, and verify that the Events web part can retrieve category choices after the correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.