Using innerJoin() in TableSort
The issue is addressed in the thread you referenced. Not all methods for the select class return the new query object. In particular, innerJoin() returns an alias string, not the query object.

Assign your query object so you can reference it outside of the method being called:

$query = db_select('users', 'u')-&gt;extend('TableSort')
$query-&gt;innerJoin('members', 'm', 'u.uid = m.uid');
//@TODO: add -&gt;fields() -&gt;execute() etc...