How to replicate the problem:

  • Create a View (Term)
  • Choose the vocabulary
  • Continue to edit the View
  • Add the relationship "taxonomy Term: Representative node"

now choosing any "Representative sort criteria" and "Representative sort order" the sort order has no effect. Indeed the Preview SQL query has no "ORDER" clause.

Also the 7.x-3.x-dev seems affected.

Am I doing something wrong?

Debugging the query using hook_views_query_alter() I noticed that the left_query ($query->table_queue['node_taxonomy_term_data']['join']->left_query) is using (some) default settings. The ORDER BY clause is always:


gambry’s picture

Flushing the cache fixes the problem, the correct subquery ORDER BY is loaded.
But you must flush the cache after any changes.

esmerel’s picture

Priority: Major » Normal
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updates after debugging