-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Set-PnPPageTextPart and Set-PnPPageWebPart cmdlets are appending extra banner section along with existing banner in the updated page after updating the new text in the Text OOB component as well as in other Components #4313
Comments
I am facing the same issue. For me, it happens when the Page has a Vertical Section. If I remove this Vertical section, it does not add the duplicate Page Title. |
Hi Aakash, Thanks for the acknowledgement, But i'm still able to reproduce this issue after trying to update the webpart in new page or existing page. Now : 23/09/2024 - 4.48PM IST Thank you, |
Hi Aakash, Could you please check once again as issue is again reproducing, Thanks |
new version of the PowerShell |
Hello, can you please try again with latest nightly builds and let us know ? Looks like it has been fixed . |
I tried with 2.12.19-nightly but still the same. |
I tried even with 2.12.20-nightly but still facing the issue. |
@gautamdsheth It seems to me like the issue is connected with the recent changes by Microsoft related to Page content handling. Could it be that the CSOM library does not support the latest M365 version yet? Is there any solution or workaround that you can suggest? |
I'm seeing this issue with pages with vertical sections when I just update/publish them, without adding or modifying the page itself. The page will have it's banner-section "reset" and an extra banner web part is added. Repro with 2.12.0:
|
I ran into this when creating automatic updating of page with a script based of PNP Powershell. I don't think the bug is in PNP Powershell, but when working with the page, like replacing a webpart, an additional header is inserted into "LayoutWebpartsContent" field. It looks like it is related to a vertical section on the page. You can reset the "LayoutWebpartsContent" with the following script: Set-PnPListItem -List "Site Pages" -Identity [insert here id of page item] -Values @{ LayoutWebpartsContent = "<div></div>" } -UpdateType SystemUpdate |
This works great, thank you! |
Reporting an Issue
While setting new text value to the Text Out of the box webpart(using Set-PnPPageTextPart cmdlet) and also while updating the webpart properties back to other oob/custom webpart (using Set-PnPPageWebPart cmdlet) programmatically through powershell, Additional banner is getting appended along with the existing banner in the updated page.
Expected behavior
Set-PnPPageTextPart and Set-PnPPageWebPart cmdlets should set the new data only on the text out of the box webpart and custom/oob webpart respectively. It should not append any new banner in the updated page after setting the text/webpart properties.
Actual behavior
Set-PnPPageTextPart and Set-PnPPageWebPart cmdlets are appending new banner after setting the new text or webpart properties for text oob/custom webparts which is weird and strange.
Ideally It should not have duplicate banner in the updated page after setting new text content in webpart.
It should update only the new text content in the oob/custom webpart.
Steps to reproduce behavior
#Note: Please create a new Modern Page and add text OOB component and add some content in it and publish the page.
Then utilize the same page name below. Please use other parameters like credentials if you are unable to connect to Sharepoint Online.
Code Snippet
$siteUrl = ""
$appId = ""
$appSecret = ""
Connect to SharePoint Online
$global:pnpConnection = Connect-PnPOnline -Url "$ ($siteUrl)" -ClientId $appId -ClientSecret $appSecret -WarningAction Ignore ReturnConnection
$pageName = "<Any new page where a simple Text OOB webpart is added in a new section after the default banner section , Eg : Page-Text-Webpart.aspx>"
try {
}$_ at $ ($.InvocationInfo.ScriptLineNumber) LineNumber In Main Function (Triggering Point)"
catch {
Write-Host "[ERROR]:
# log -content "[ERROR]: $ at $($_.InvocationInfo.ScriptLineNumber) LineNumber In Main Function (Triggering Point)" -path $logParentFilePath
$parentLogCount.Status = "Error"
}
$global:pnpConnection = $null
Page before updating new text in Text OOB webpart :
Page after updating new text in Text OOB webpart :
What is the version of the Cmdlet module you are running?
ModuleType Version Pre-release Name PSEdition
Manifest 2.1.1 PnP.PowerShell Desk
Which operating system/environment are you running PnP PowerShell on?
##Powershell Version - 7.4.5
##node version - v16.17.1
##npm version - 8.15.0
Please suggest a resolution for this issue.
Note : I'm able to reproduce the same issue by using latest PnP Version - 2.12.0, Kindly check and update.
Thank you,
Sreekrishna Sai
The text was updated successfully, but these errors were encountered: