-
Notifications
You must be signed in to change notification settings - Fork 306
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
validateUpdateListItem does not work after coAuthoring was enabled #3119
Comments
I have also encountered this issue, and I want to add some more information. The validateUpdateListItem request URL made by SharePoint when updating fields in the Page Details is slightly different than the PnPJs one, but I am not sure if that is relevant or not. For me it looked like this: https://{DOMAIN}.sharepoint.com/sites/{SITE}/_api/web/GetList(@A1)/items(@a2)/ValidateUpdateListItem()?@A1=%27%2Fsites%2F{SITE}%2FSitePages%27&@a2='{ItemId}' When providing the sharedLockId in the body to the above URL, the request works, and the field value is updated. I tried it by by manually finding the sharedLockId and making a request with the spHttpClient. I have not tried to provide the same request body to the PnPJs validateUpdateListItem method. Unfortunately, I haven't found a (good) way to programmatically get the sharedLockId. |
This issue all revolves around first party APIs, specifically the Pages API that currently in PnPjs is a reverse engineered version of those 1st party APIs, for more details see this documentation. At this point since a less robust publicly supported pages API has been GA'd we are in a holding pattern. We could remove our implementation and implement the public one but that will mean removing a lot of the functionality. IF someone wants to take a stab at it, PR's are welcome. With regard to changes for ValidateUpdateListItem, it's possible new options have been added to the payload other than what we've typed, if you have recommended changes please let us know. |
SharePoint Client-side Pages API is being deprecated and no changes will be made to the existing endpoint. Closing this issue to track pages updates to #3137 |
This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked. |
Major Version
3.x
Minor Version Number
1.0
Target environment
SharePoint Framework
Additional environment details
SPFX webpart
Expected or Desired Behavior
I have SPFX webpart which is added into the Page. This webpart has Taxonomy picker and users can select tags. This selection is instantly saved into Page field (
TaxKeyword
). Before coauthoring was enabled - this webpart worked fine. Now it throws error "The file "https://xxxxxx.sharepoint.com/sites/yyyyyyy/SitePages/Testing-keywords.aspx" is locked for shared use by [email protected].". The email in the error is my user email.When I open Page properties I can save field
TaxKeyword
manually and then it saves correctly. The difference is that Microsoft's implementation ofvalidateUpdateListItem
passes 2 additional parameters:I think sharedLockId is essential here, but I have no idea how to generate or retrieve one.
Do you have any idea how this should be solved ?
As a workaround I enabled "Require check out" in Library properties (this disables coauthoring), but our users were waiting for coauthoring feature and want to continue using it.
Do you have any idea how this should be solved ? I did not find anything in pnpjs documentation about sharedLockId.
Observed Behavior
Error while saving page properties. Was working fine before coauthoring was enabled by microsoft.
Steps to Reproduce
Create new Page in Site Pages library and Edit it, leave it in edit mode.
Then create PowerAutomate flow with manual trigger and second action "Send an HTTP request to SharePoint" with Body like this:
{"formValues":[{"FieldName":"Title","FieldValue":"Testing"}],"bNewDocumentUpdate":false}
you will receive error 423 : Locked
The text was updated successfully, but these errors were encountered: