SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.02k forks source link

SharePoint Multilingual - Rest API filters are always querying with English values for Terms (MANAGED METADATA) though user is a FRENCH user #9973

Open WhyNotSantosh opened 1 month ago

WhyNotSantosh commented 1 month ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Developer environment

None

What browser(s) / client(s) have you tested

Additional environment details

Chrome - Version 130.0.6723.58 (Official Build) (64-bit) SPFx - 1.17.3 Nodejs - 16.18.1

Describe the bug / error

Rest API filters are always querying with English values for Terms (MANAGED METADATA) though user is a FRENCH user. I have the below query that is not working and unable to get results.

Rest API (Not working for French user): https://mytenant.sharepoint.com/sites/mysite/_api/web/lists/getByTitle('Site Pages')/items?$filter=(StartDateTime le datetime'2024-10-18T02:54:09.168Z' and EndDateTime ge datetime'2024-10-18T02:54:09.168Z' and ContentType eq 'News' and OData__ModerationStatus ne 3 and (TaxCatchAll/IdForTerm eq '----****') and (TaxCatchAll/Term eq 'Litige et résolution de conflits')) and FileDirRef eq '/sites/mysite/SitePages/fr'&$select=ID,Title,Summary,NewsAuthor/Id,NewsAuthor/Title,NewsAuthor/UserName,NewsAuthor/FirstName,NewsAuthor/LastName,RelatedPeople/Id,RelatedPeople/Title,RelatedPeople/UserName,Featured,StartDateTime,EndDateTime,EncodedAbsUrl,NewsTypes,TaxCatchAll,TaxCatchAll/Term,TaxCatchAll/Id,TaxCatchAll/IdForTerm,BannerImageUrl&$expand=NewsAuthor,RelatedPeople,TaxCatchAll,TaxCatchAll/Term,TaxCatchAll/Id,TaxCatchAll/IdForTerm

Rest API (Working for French user): https://mytenant.sharepoint.com/sites/mysite/_api/web/lists/getByTitle('Site Pages')/items?$filter=(StartDateTime le datetime'2024-10-18T02:54:09.168Z' and EndDateTime ge datetime'2024-10-18T02:54:09.168Z' and ContentType eq 'News' and OData__ModerationStatus ne 3 and TaxCatchAll/Term ne 'Client Success Stories' and (TaxCatchAll/IdForTerm eq '----****') and (TaxCatchAll/Term eq 'Litigation and Dispute Resolution')) and FileDirRef eq '/sites/mysite/SitePages/fr'&$orderby=StartDateTime desc&$top=50&$select=ID,Title,Summary,NewsAuthor/Id,NewsAuthor/Title,NewsAuthor/UserName,NewsAuthor/FirstName,NewsAuthor/LastName,RelatedPeople/Id,RelatedPeople/Title,RelatedPeople/UserName,Featured,StartDateTime,EndDateTime,EncodedAbsUrl,NewsTypes,TaxCatchAll,TaxCatchAll/Term,TaxCatchAll/Id,TaxCatchAll/IdForTerm,BannerImageUrl&$expand=NewsAuthor,RelatedPeople,TaxCatchAll,TaxCatchAll/Term,TaxCatchAll/Id,TaxCatchAll/IdForTerm

Not sure why this is happening. This used work as expected few days ago.

Steps to reproduce

  1. Change browser settings to English
  2. SharePoint reloads in French
  3. Check network tab with the French labels query that returns no data

Expected behavior

Based on the user browser language the filter values translate but the output of the filter query should not change.