-
Notifications
You must be signed in to change notification settings - Fork 194
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
Page description not changing automatically after page creation (but normally it should). #790
Comments
Hi, any update on this? |
It appears something similar occurs in the new PnP.Framework sp npm package: We are having the same issue using the new framework as described above. It's quite easy to reproduce, using the PnP .save(...) method on an existing page seems to lead to the description property no longer updating automatically when subsequently editing text on the page manually. The issue with this is that we rely on this description property for e.g. news lister rollups using SP search. End users should not manually fill out this value, it should be updated automatically based on the text on the page. It would be really helpful for us if there is any acknowledgement of this behaviour. It's quite a basic and useful command, so it would be a shame to not be able to use it freely. It's quite the caveat for an intranet application. |
We've been able to fix this by modifying the CanvasContent1 property of the page. It has to do with its contents. You can change it back such that the default description is being used again. Just be careful when updating its contents, as it is a lengthy string with lots of values. |
@PieterHeemeryck : can you clarify what you've changed...will help speed up a fix for this :-) |
Of course. One replacement is always done: setting the flag i'sDefaultDescription' to true. We also execute a more involved regex replace, but we've noticed that not every tenant or site collection plays well with that one, so it's made defensive. Not completely sure if the involved regex is needed as well. // reset possible broken description const htmlAttributesRegex = /("htmlAttributes":[(.?)])/g; if (!!matches) { await spHttpClient.post( |
@grillaertr , @PieterHeemeryck : I've just committed a fix for this. Now the behavior aligns with what you would get for a manually created page. When a page is created the library sets a default description, but leaves it marked as "default"...when a user then edits the page the description is overwritten depending on the user's edits and this should also reflect in roll up web parts (search/caching might delay this a bit). Note, when programmatically updating a page we're not overwriting the existing description if any was set. We do respect the default description flag if it was set before, so a page that was given a custom description via the UI will stay in that mode on page edit. For now we do not offer an option to change a custom description, if you feel that's needed then let me know. Note that I'm also closing this case for now, please try with the next nightly (or 1.6 which we hope to release soon) and if you still see issues then please re-open or create a new issue. |
Normally, when creating a new site page in SharePoint and adding a text webpart, the page description property changes depending on the displayed text (unless the page description property is changed manually, then the link between text in webparts and the page description is gone). But when I create a new site page using PnP Powershell or custom code (with or without adding a text webpart), the link between the text in webparts and the description property of the site page is gone. I guess this issue is because even tho there is no text on the site page, the site page description is still changed in the code (Starting on line 1288).
The text was updated successfully, but these errors were encountered: