Fixing bug where quota was refering to preferred instead of default site
Work-around for mysql's DISTINCT/OFFSET bug

The base list now sorts by the subject's id if there is no sorting being used.
We MUST do this since the select which gets this list is using the DISTINCT keyword,
but MySQL has a bug when using distinct which doesn't return the right rows when
using LIMIT and OFFSET unless we are also using the ORDER keyword
Merge remote branch 'origin/release' into develop