pnp / PnP

SharePoint / Office 365 Developer Patterns and Practices - Archived older solutions. Please see https://aka.ms/m365pnp for updated guidance
https://aka.ms/m365pnp
Other
1.89k stars 3.31k forks source link

Enable-PnPFeature for "Site Feed" feature breaks "Newsfeed.aspx" page and makes impossible to disable feature manually #1884

Open vtkachenko opened 4 years ago

vtkachenko commented 4 years ago

Repository

Category

[x] Bug

Environment

[x] Office 365 / SharePoint Online

Expected or Desired Behavior

When you invoke Enable-PnPFeature for "Site Feed" feature on a new SPO site - you expect:

  1. "Site Feed" feature is activated.
  2. "Newsfeed.aspx" page appears on a site.
  3. "Newsfeed" webpart is added on this page (content is empty, of course).

Observed Behavior

  1. "Site Feed" feature is activated (all good there).
  2. "Newsfeed.aspx" page appears on a site (all good as well).
  3. "Newsfeed" webpart is added, but it's not displayed because of an error:
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. You don't have Add and Customize Pages permissions required to perform this action. Correlation ID: 7e770c9f-1086-1000-2e9b-accd7cccd5fa.

image

And now you cannot deactivate "Site Feed" feature MANUALLY: it throws internal SharePoint error when attempting:

image

Steps to Reproduce

Invoke the following script:

Import-Module  SharePointPnPPowershellOnline -DisableNameChecking
Connect-PnPOnline -Url https://tenantName.sharepoint.com/sites/site1 -Credential (Get-Credential)
$siteFeedFeatureId = "15a572c6-e545-4d32-897a-bab6f5846e18" # Stable "Site Feed" feature ID

Enable-PnPFeature -Identity $siteFeedFeatureId

And then try to access https://tenantName.sharepoint.com/sites/site1/newsfeed.aspx. You will see an error message, specified above.

Tested on 2 different tenants.

AnisELTAIEF commented 4 years ago

Hi @vtkachenko , you can restore permissions using this command; "Set-PnPListItemPermission"
you can see also; https://www.sharepointdiary.com/2016/09/sharepoint-online-set-folder-permissions-powershell.html

vtkachenko commented 4 years ago

Hi @vtkachenko , you can restore permissions using this command; "Set-PnPListItemPermission" you can see also; https://www.sharepointdiary.com/2016/09/sharepoint-online-set-folder-permissions-powershell.html

Hi, AnisELTAIEF,

Sorry, but I don't understand, how Set-PnPListItemPermission can help with this issue. To WHICH list item I should apply it? "Newsfeed.aspx" is a classic service page, which is created, when "Site Feed" feature is enabled. It's not an item in a list.

AnisELTAIEF commented 4 years ago

You are right, In your case , you need to reset Inheritance ; https://www.sharepointdiary.com/2016/01/sharepoint-online-delete-unique-permissions-using-powershell.html

vtkachenko commented 4 years ago

You are right, In your case , you need to reset Inheritance ; https://www.sharepointdiary.com/2016/01/sharepoint-online-delete-unique-permissions-using-powershell.html

Reset inherirance WHERE? :) https://tenantName.sharepoint.com/sites/site1 is a SITE COLLECTION, so it has its own permission set. There is nothing to reset.

Did you read the details of an issue, @AnisELTAIEF ? Did you try to reproduce it in our own tenants? Sorry, but I don't understand, why you are suggesting something with permissions here.

UPDATE: Are you talking about INHERITING permissions to built-in "MicroFeed" list? ~Can it keep "Site Feed" feature activated, despite the request to deactivate?~

image

I'll try that now.

UPDATE 2: No, that doesn't work as well.