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
Using the sample code from the documentation to traverse a TermSet, an exception is produced if you attempt to go more than 2 levels deep.
The exception is:
PnP.Core.MicrosoftGraphServiceException: 404Code: itemNotFoundMessage: Term with id 96bd5df3-b4a9-490b-8a4a-796e9d15177b not found
Where the id is the id of the term who's children I am trying to load.
Steps to reproduce
Configure a term set with a term tree depth of more than two
Use this is the code from the documentation, modified to go one level deeper (plus a few extra try/catches):
vartermSet=awaittermGroup.Sets.GetByIdAsync(spField.TermSetId.ToString());awaittermSet.LoadAsync(p =>p.Terms);foreach(vartermintermSet.Terms.AsRequested()){// Load the child terms of this termtry{awaitterm.LoadAsync(p =>p.Terms);foreach(varchildTerminterm.Terms.AsRequested()){try{// New load to get the grandchildrenawaitchildTerm.LoadAsync(p =>p.Terms);foreach(vargrandchildTerminchildTerm.Terms.AsRequested()){// Do something with the term;}// Do something with the term}catch{;}}}catch{;}// Do something with the term}
This line:
awaitchildTerm.LoadAsync(p =>p.Terms);
fails every time, with the above exception, regardless of whether childTerm actually has children or not.
Expected behavior
Using the sample code from the documentation to traverse a TermSet, I expect to be able to traverse a nested term set for as many levels as it goes.
@IvanTheBearable : fix has been added, will be part of nightly build 1.6.49 or higher. Closing the issue here, feel free to re-open or create a new one if the fix is not helping.
Category
Describe the bug
Using the sample code from the documentation to traverse a TermSet, an exception is produced if you attempt to go more than 2 levels deep.
The exception is:
Where the id is the id of the term who's children I am trying to load.
Steps to reproduce
This line:
fails every time, with the above exception, regardless of whether childTerm actually has children or not.
Expected behavior
Using the sample code from the documentation to traverse a TermSet, I expect to be able to traverse a nested term set for as many levels as it goes.
Environment details (development & target environment)
Additional context
There is a workaround. If I re-load the child term using this:
I can then get its child terms with:
The text was updated successfully, but these errors were encountered: