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
When I compare the request created from CSOM and PnP.Core, you can see that instead of multiple calls for SetFieldValue like CSOM there is a single call SetFieldValue with multiple parameters and that doesnt seem to work when updating multiple properties in a single update.
And in the source in src/sdk/PnP.Core/Services/Core/CSOM/Requests/Web/UpdatePropertyBagRequest.cs, I see the following snippet for creating the request, and I think this loop should produce multiple ActionObjectPath instead of a single with multiple parameters
publicList<ActionObjectPath>GetRequest(IIdProvideridProvider){intupdateActionId= idProvider.GetActionId();IdentityPath= idProvider.GetActionId();intpropertiesId= idProvider.GetActionId();List<Parameter>parameters=newList<Parameter>();foreach(CSOMItemField field in FieldsToUpdate){
parameters.AddRange(field.GetRequestParameters());}returnnewList<ActionObjectPath>(){new ActionObjectPath(){Action=new MethodAction(){Id=updateActionId,Name="SetFieldValue",ObjectPathId= propertiesId.ToString(),Parameters=parameters},ObjectPath=new Property(){Id=propertiesId,ParentId=IdentityPath,Name=PropertyName}},new ActionObjectPath(){Action=new MethodAction(){Id=updateActionId,ObjectPathId= IdentityPath.ToString(),Name="Update",Parameters=newList<Parameter>()},ObjectPath=new Identity(){Id=IdentityPath,Name=$"121a659f-e03e-2000-4281-1212829d67dd|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:{SiteId}:web:{WebId}{ObjectId}"}}};}
Thanks for using PnP Core SDK and reporting this @ronaldvanhelden. I've been able to reproduce and create a fix + corresponding test case for this. This change will be part of the next nightly release, as such I'm closing this issue now. If you still face issues when using the next nightly then please re-open or create a new issue.
Category
Describe the bug
When updating multiple web properties, only the first will be executed.
using this snippet, only the first gets created.
When I compare the request created from CSOM and PnP.Core, you can see that instead of multiple calls for SetFieldValue like CSOM there is a single call SetFieldValue with multiple parameters and that doesnt seem to work when updating multiple properties in a single update.
And in the source in
src/sdk/PnP.Core/Services/Core/CSOM/Requests/Web/UpdatePropertyBagRequest.cs
, I see the following snippet for creating the request, and I think this loop should produce multipleActionObjectPath
instead of a single with multiple parametersSteps to reproduce
Execute this snippet
Expected behavior
When executing the snippet to update multiple web properties in a single call like CSOM would do.
Environment details (development & target environment)
The text was updated successfully, but these errors were encountered: