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

Exception when adding site collection term group #1041

Closed
1 task done
stefan-at-ilionx opened this issue Nov 26, 2022 · 2 comments
Closed
1 task done

Exception when adding site collection term group #1041

stefan-at-ilionx opened this issue Nov 26, 2022 · 2 comments
Assignees
Labels
area: model 📐 Related to the core SDK models bug Something isn't working

Comments

@stefan-at-ilionx
Copy link

Category

  • Bug

Describe the bug

When I try to add a new site collection term group, I receive the following message:

[termGroupModel] Cannot read the value '2' as a quoted JSON string value.

With this stacktrace:

PnP.Core.MicrosoftGraphServiceException: Microsoft Graph service exception
   at PnP.Core.Services.BatchClient.ExecuteMicrosoftGraphInteractiveAsync(Batch batch)
   at PnP.Core.Services.BatchClient.ExecuteMicrosoftGraphBatchAsync(Batch batch)
   at PnP.Core.Services.BatchClient.ExecuteBatch(Batch batch)
   at PnP.Core.Model.BaseDataModel`1.BaseAdd(ApiCall postApiCall, Func`2 fromJsonCasting, Action`1 postMappingJson)
   at PnP.Core.Model.BaseDataModel`1.AddAsync(Dictionary`2 keyValuePairs)
   at PnP.Core.Model.SharePoint.TermGroupCollection.AddAsync(String name, String description, TermGroupScope scope)

Steps to reproduce

Call this method and see the exception being thrown:

var store = await pnpContext.TermStore.GetAsync();
var termGroup = await store.Groups.AddAsync(name: "Group name", scope: TermGroupScope.SiteCollection);

Expected behavior

I expect the term group being created under the site collection scope without any exceptions.

Environment details (development & target environment)

  • SDK version: 1.6.0 (I've also tried updating to 1.8.0, didn't work)
  • OS: Windows 10
  • SDK used in: Azure Function
  • Framework: .NET Core 3.1
  • Browser(s): N/A
  • Tooling: JetBrains Rider 2022.2.3
@jansenbe jansenbe self-assigned this Nov 26, 2022
@jansenbe jansenbe added area: model 📐 Related to the core SDK models bug Something isn't working labels Nov 26, 2022
@jansenbe
Copy link
Contributor

@stefan-at-ilionx : I've added fix for this issue, will appear in the next nightly build (version 1.8.20 or higher). Thanks for using PnP Core SDK and reporting this issue.

@stefan-at-ilionx
Copy link
Author

@jansenbe Awesome, thanks! I can confirm that it works. 😄

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