Skip to content
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

IClientsidePage Save - New behavior #3176

Open
SwissSeb opened this issue Dec 9, 2024 · 3 comments
Open

IClientsidePage Save - New behavior #3176

SwissSeb opened this issue Dec 9, 2024 · 3 comments

Comments

@SwissSeb
Copy link

SwissSeb commented Dec 9, 2024

Major Version

4.x

Minor Version Number

6.0

Target environment

SharePoint Framework

Additional environment details

A Web Part component of a SharePoint site performs the following actions:

  • Creation of a CopyTo page from a template
  • Then loadClientsidePage to perform additional actions
  • Save
    When I use the Save method of the IClientsidePage a second header is generated when the page is reloaded.

Expected or Desired Behavior

No second header is generated on page reload

Observed Behavior

A second header is generated when the page is reloaded after save.

Steps to Reproduce

This is not an step to reproduce but the cause of the problem :

In the sources of packages/sp/clientside-pages/types.ts the method getDefaultLayoutPart() refers to version 1.4 and 1.6 which is currently in SharePoint.

The problem is not the version but the instanceID which is currently "cbe7b0a9-3504-44dd-a3a3-0e5cacd07788" and not 'ba676af7-eb4b-43f5-936a-80155f88be18'

A possible workaround is to override the value before the Save :
page['_layoutPart']['instanceId'] = 'ba676af7-eb4b-43f5-936a-80155f88be18';

@juliemturner
Copy link
Collaborator

There are a significant number of issues with the SharePoint pages api that is currently implemented as it's a tremendeous amount of work to maintain the reverse engineered, and therefore unsupported API. The team made the decision to stop maintaining that implementation and have begun to implement the new pages api built into the Microsoft Graph. A beta endpoint (import "@pnp/graph/pages") exists although there are no docs as of yet as it's still in progress.

We'd certainly be open to PRs again the old endpoint, but we consider it deprecated.

@SwissSeb
Copy link
Author

Glad to hear it, any idea of ​​availability ?

@juliemturner
Copy link
Collaborator

We are not paid resources so it's all dependent on when one of us has time to work on it. We do accept PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants