Pnp-sites-core: [BUG] Client Site Page: InstantiateDefaultWebPart of type List returns Null

Created on 29 Sep 2020  路  13Comments  路  Source: pnp/PnP-Sites-Core

When try to InstantiateDefaultWebPart with DefaultClientSideWebParts.List it returns NULL. When try InstantiateDefaultWebPart with DefaultClientSideWebParts.NewsFeed it works fine. I have tried different versions of PnP but still same issues, this has previosly been working without any issues.

We have a lot of custom solutions depending of this functionallity and its very import to have this issue corrected. We have now this issue on 5 different tenants.

  var authManager = new OfficeDevPnP.Core.AuthenticationManager();

  ClientContext ctx = authManager.GetSharePointOnlineAuthenticatedContextTenant(
    "https://xxx.sharepoint.com",
    "XXX",
    "YYY");

  Web web = ctx.Web;
  ctx.Load(web);
  ctx.ExecuteQueryRetry();

  string welcomePagePath = web.WelcomePage;

  string[] welcomePathParts = welcomePagePath.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
  var welcomePageName = welcomePathParts[welcomePathParts.Length - 1];
  var page = web.LoadClientSidePage(welcomePageName);


  var listWebPart = page.InstantiateDefaultWebPart(DefaultClientSideWebParts.List);

  listWebPart == NULL

   var components = page.AvailableClientSideComponents();

  // get default List WebPart => f92bf067-bc19-489e-a556-7fe95f508720
  var defaultListWebPart = components.Where(s => s.ComponentType == 1 && s.Name == "f92bf067-bc19-489e-a556-7fe95f508720").FirstOrDefault();

  defaultListWebPart == NULL

Environment

[X] Office 365 / SharePoint Online
[ ] SharePoint 2016
[ ] SharePoint 2013

SharePointPnPCoreOnline 3.25.2009.1 and 3.22.2006.2

Needs

Most helpful comment

The root cause of the problem has been found and a fix is rolling out soon.

All 13 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

I'm experiencing issues that seem related using the PnP-PowerShell module.

Applying a template with Apply-PnPProvisioningTemplate fails to create list webpart on pages included in template.
Trying to add a list WebPart to a page with Add-PnPClientSideWebPart fails with a Null reference exception. I submitted an issue for this one in the PnP-Powershell project.

It's critical as our site creation automation processes can't create new valid templated sites anymore.

Duplicate of #2779

We are also now having issues with Apply-PnPProvisioningTemplate. Our new sites created from template no longer include the list web parts on the site pages. This worked 2 days ago

the underlying issue as described in #2779 is preventing any list web part provisioning, being it via the API, via provisioning engine or via page transformation. Engineering is looking into the root cause right now

@jansenbe any updates from engineering when this issues will be corrected? Is there any workarounds to temporary solve this issue?

@jansenbe - our server does not have an internet connection using the old version of PnP Powershell SharePoint Online even though we are getting "Null Value" issue while adding "Add-PnPClientSideWebPart"

Kindly answer how the old version of PnP PowerShell also throwing an error same error when it is not upgraded to a newer version.

same for us, looks like not related to pnp engine (we have not upgraded it for almost a year); on our tenant the issue started this week, all our newly provisioned pages are missing list webparts - ughh

The root cause of the problem has been found and a fix is rolling out soon.

@jansenbe seems to be working now for one of our customer tenants 馃憤

Think we can close, there's many independent confirmations the issue is fixed

Thanks a ton - Now it is working like a charm !!

thanks. Its working again

Was this page helpful?
0 / 5 - 0 ratings