Fixing sorting in relationships

I found that the ordering was doing previous to the specific controller (many to many, has many) because it was done in the parent, then, if you putted some getter it will take an error because it didn't found a name_field in the DB and it was not taking the sorting field, with this option it adds the sortField if exists and if not still uses the nameField