Last issue that was similar was back in 5.x, so I'm sure this has been reported but can't find an exact match.

When you use click sorting the click sort goes *after* the sort criteria, which is not correct (in my opinion) because it limits the ability to sort by the thing the user cares about, and then apply a "default sort". Perhaps something changed at one point and click sort used to be applied before sort criteria?

I have a hack but I'm sure there's a better solution (such as adding a parameter to the add_orderby method).

Two files appear to need the modification

  • handlers/field/views_handler_field.inc:170 - $this->query->add_orderby(NULL, NULL, $order, $this->field_alias, $params);
  • modules/field/views_handler_field_field.inc:329 - $this->query->add_orderby(NULL, NULL, $order, $this->aliases[$column]);

After each add_orderby:

//grab the order that was just added and pop it off the queries orderby array
$el = array_pop($this->query->orderby);

//move it to the front of the array
array_unshift($this->query->orderby,$el);