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
Bug report: Cannot get term by name if it is a child of another term #4346
Comments
I'd like to have a look at this. |
Great to hear! All yours! |
@martinlingstuyl @milanholemans I've managed to find the solution for the issue. I have however one more question. Currently, when we don't find a term either by id or by name, we just use |
Another question: What is multiple terms get found? Should we log them all? |
Good questions @MathijsVerbeeck, in my opinion:
Correct me if I'm wrong @pnp/cli-for-microsoft-365-maintainers |
Nothing to correct 😉. I agree with the approach 👍. |
Hi @MathijsVerbeeck, Awesome! I'm curious to see how you solved it! I agree with you that we should show a message when no term is found. Feel free to add that in this PR. Also: when multiple terms are found, a disambiguation prompt should be shown, where the user may specify what term he meant. We use disambiguation prompts in multiple places in the source code, you can check one of those for inspiration. The most helpful scenario would be that you see the id and the term path of the term, so the user can decide easiest what term he meant. He may then copy the id and reuse the term get command with the id option. |
Quite easily. Currently, we were just simply using the CSOM operation
This has been done in the PR.
I will implement this after the first review. I believe that there will be some comments 😄 |
Hi @MathijsVerbeeck, if the data for the term path is available, that would be what you want to see, combined with the id, so you can select that and execute the command again. If that means updating the interface, then that's okay. |
@martinlingstuyl I've changed the output when multiple terms were found. It will now look like this: |
Very nice @MathijsVerbeeck! |
Description
If I try to get a term by name, it will not find it if the term is a child or grandchild in a hierarchy:
The following will throw an error:
Error: Specified argument was out of the range of valid values.
Parameter name: index
However, the term does exist and it can be retrieved by
id
.The same operation with a top level term will succeed.
Steps to reproduce
Create a taxonomy hierarchy and try to retrieve the top-level and child-level terms by name.
Expected results
It finds the term
Actual results
It does not
Diagnostics
No response
CLI for Microsoft 365 version
6.1 (next)
nodejs version
16
Operating system (environment)
Windows
Shell
PowerShell
cli doctor
No response
Additional Info
No response
The text was updated successfully, but these errors were encountered: