Clone SelectQuery doesn't seem to work
So, I was working on a test for @Mołot to reproduce the clone bug, and I couldn't with a fresh view.

I tracked down the difference :


With the filter Published or admin: the cloned query didn't return anything.
No problem with the simple Published filter.


Don't ask me why.

As @autopoietic said, working with core query_alter_hook wasn't a good idea. I switched to views hook, and got the SelectQuery object :

function mymodule_views_pre_execute(&amp;$view) {
  $query = &amp;$view-&gt;build_info['query'];
}


Then I was able to do my sorting.