Only allow sort fields that match the current object alias.

Backport 37ce6dfc81d10414545a69f55471ed27a593fa3c to 1.3

Fixes #3803