We recently upgraded our Sitefinity version from 8 to 10. In a scenario we are fetching hierarchical taxonomies as below
var someTaxa= manager.GetTaxa<
>().Where(t => t.Taxonomy.Name == "some-name");
.Where(t => (t.Parent != null && t.Parent.Name == "X" && t.Taxonomy.Name == "some-other-name")
&& (!someTaxa.Any(pw => pw.Name == t.Name))) //Filter out Taxanomies that have no "some-name".
.OrderBy(t => t.Ordinal).ToList();
This was working fine in Sitefinity 8, after upgrade it threw an error of type "Telerik.OpenAccess.Exceptions.DataStoreException" with message "Error executing query: Telerik.OpenAccess.RT.sql.SQLException: The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified."
Is there any change in implementation of taxonomy manager and how to write query for the given scenario
Simplified the query as below, so it wont have sub query.
>().Where(t => t.Taxonomy.Name == "some-name").ToList();
var someOtherTaxa= manager.GetTaxa<
>().Where(t => t.Parent != null && t.Parent.Name == "X" && t.Taxonomy.Name == "some-other-name").ToList();