SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.24k stars 1.01k forks source link

CAML's AddAllFields parameter breaks `Author` and `Editor` field #9361

Open RoelVB opened 11 months ago

RoelVB commented 11 months ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Developer environment

None

What browser(s) / client(s) have you tested

Additional environment details

SharePoint API

Describe the bug / error

When setting the parameter AddAllFields: true when doing a CAML request, it returns a Author and Editor property with an incorrect title, email and sip property

Steps to reproduce

Call RenderListDataAsStream with the body:

{"parameters":{"__metadata":{"type":"SP.RenderListDataParameters"},"AddAllFields":true}}

This will return a strange Author and Editor property:

{
  "Author": [{"id":"7","title":"7","email":"7","sip":"7","picture":""}],
  "Editor": [{"id":"7","title":"0","email":"7","sip":"1.0","picture":""}],
}

Expected behavior

When specifically requesting the Author and Editor fields like this:

{"parameters":{"__metadata":{"type":"SP.RenderListDataParameters"},"ViewXml":"<View><ViewFields><FieldRef Name='Author' /><FieldRef Name='Editor' /></ViewFields></View>"}}

We get the expected response:

{
  "Author": [{"id":"7","title":"Roel","email":"roel@contoso.onmicrosoft.com","sip":"roel@contoso.onmicrosoft.com","picture":""}],
  "Editor": [{"id":"7","title":"Roel","email":"roel@contoso.onmicrosoft.com","sip":"roel@contoso.onmicrosoft.com","picture":""}],
}
ghost commented 11 months ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

RoelVB commented 11 months ago

I did some additional testing on two other tenants and could not reproduce this issue there.

My initial tests where on a development tenant. I assume this tenant is probably ahead in terms of updates?

RoelVB commented 8 months ago

This seems to be happening in any SharePoint environment!

I'm pretty sure this is related to the number of peoplepickers in a single list. This first few will work as expected, but when you have over 12 (I didn't verify this number) peoplepickers in one list the rest of them will return the user's id for every property.