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

No user field returned on Version items #1031

Closed
1 task done
aidanbha79 opened this issue Nov 14, 2022 · 2 comments
Closed
1 task done

No user field returned on Version items #1031

aidanbha79 opened this issue Nov 14, 2022 · 2 comments
Assignees
Labels
area: model 📐 Related to the core SDK models bug Something isn't working

Comments

@aidanbha79
Copy link

aidanbha79 commented Nov 14, 2022

Category

  • Bug

Describe the bug

When I try and get all the version history from a list item it doesn't contain any of the User lookup fields as part of it. these are being set on the create and when I look at the values on the main parent it has the values. I need to check if an item has been assigned to someone else.

Steps to reproduce

`
using var context = await _pnpContextFactory.GetContextAsyncForSite(url);
var myList = await context.Web.Lists.GetByTitleAsync(listName,
p => p.Title,
p => p.Items,
p => p.Fields,
p => p.Fields.QueryProperties(p => p.InternalName,
p => p.FieldTypeKind,
p => p.TypeAsString,
p => p.Title));

        await myList.LoadListDataAsStreamAsync(new RenderListDataOptions()
        {
            RenderOptions = RenderListDataOptionsFlags.ListData
        });

        var foundItem = await myList.Items.GetByIdAsync(id, li => li.All, li => li.Versions);
        Dictionary<int,object> items = new Dictionary<int, object>();
        foreach (var version in foundItem.Versions.AsRequested())
        {

            var versionLabel = version.VersionLabel;
            items.Add(version.VersionLabel.ToInteger(0), version.Values);
        }
        items.Add(items.Count + 1, foundItem.Values);

`

Expected behavior

Should show the user lookup fields within the version values.

Environment details (development & target environment)

  • SDK version: 1.7.0
  • OS: windows 11
  • SDK used in: ASP.Net Web app
  • Framework: .Net 6.0
  • Browser(s): Chrome
  • Tooling: Visual Studio 2022

Additional context

Thanks for your contribution! Sharing is caring.

@jansenbe jansenbe self-assigned this Nov 14, 2022
@jansenbe jansenbe added bug Something isn't working area: model 📐 Related to the core SDK models labels Nov 14, 2022
@jansenbe
Copy link
Contributor

@aidanbha79 : I can confirm that the lookup field is skipped when parsing the API call response, so clearly a bug. Will work on a fix. Thanks for using PnP Core SDK and reporting this issue.

@jansenbe
Copy link
Contributor

@aidanbha79 : this has been fixed, please try again with the next nightly build (version 1.8.8 or higher). I'm closing this issue now, feel free to re-open in case the fix is not working for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: model 📐 Related to the core SDK models bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants