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

ModernTaxonomyPicker can't find term when UI is in language not supported by term store #1573

Closed
Zhephyr54 opened this issue Jun 29, 2023 · 5 comments
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:enhancement New feature or enhancement of existing capability
Milestone

Comments

@Zhephyr54
Copy link
Contributor

Category

[ ] Enhancement

[X] Bug

[ ] Question

Version

Please specify what version of the library you are using: [3.13.0]

Expected / Desired Behavior / Question

Using the ModernTaxonomyPicker when the SharePoint UI is in a language not supported by the term store (= not in termStoreInfo.languageTags), we should be able to search terms from the text field and find them in the default term store language.

Observed Behavior

Using the ModernTaxonomyPicker when the SharePoint UI is in a language not supported by the term store (= not in termStoreInfo.languageTags), while searching terms from the text field, no term can be found at all (the call to the termStore unofficial SP API is returning a 500 error code with the following details: "Specified argument was out of the range of valid values.\r\nParameter name: lcid").

moderntaxonomypicker lang error

Steps to Reproduce

  • Use the ModernTaxonomyPicker with another UI language than english from a SharePoint site where the site collection termstore only supports english language (or with any other language not supported by the termstore)
  • Search for any term from the text input
  • No result will be return

Personal note

Looking at the code, I think it should not be hard to implement a fix.
After the first render, the language used by the component is set like this:

const languageTag = props.context.pageContext.cultureInfo.currentUICultureName !== '' ?
          props.context.pageContext.cultureInfo.currentUICultureName :
          currentTermStoreInfo.defaultLanguageTag;

As we already have the currentTermStoreInfo, we could just check the currentUICultureName against the termStoreInfo.languageTags array and use currentTermStoreInfo.defaultLanguageTag if the current UI language is not supported (= not inside the termStoreInfo.languageTags array) by the term store.

Thanks!

@ghost
Copy link

ghost commented Jun 29, 2023

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Jun 29, 2023
@github-actions
Copy link

Thank you for submitting your first issue to this project.

@Zhephyr54
Copy link
Contributor Author

I have just submitted a PR to fix this issue: #1576

@joelfmrodrigues joelfmrodrigues added type:enhancement New feature or enhancement of existing capability status:fixed-next-drop Issue will be fixed in upcoming release. and removed Needs: Triage 🔍 labels Jul 6, 2023
@joelfmrodrigues joelfmrodrigues added this to the 3.15.0 milestone Jul 6, 2023
@joelfmrodrigues
Copy link
Collaborator

Merged and will be in the beta release very soon. Please let us know if you find any issues

@joelfmrodrigues
Copy link
Collaborator

New release just published, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release. type:enhancement New feature or enhancement of existing capability
Projects
None yet
Development

No branches or pull requests

2 participants