You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 of validateUpdateListItem passes 2 additional parameters:
checkInComments
sharedLockId
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:
I have also encountered this issue, and I want to add some more information.
In the DOM, there is a variable called spClientSidePageContext. When editing a page, this variable contains a CoAuthState object with a SharedLockId property.
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.
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: