Skip to content

Exception when adding site collection term group #1041

@stefan-at-ilionx

Description

@stefan-at-ilionx

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

Metadata

Metadata

Assignees

Labels

area: model 📐Related to the core SDK modelsbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions