correct getLatestTDoc for polymorphic families (refs #4279)
correct gettdoc functions for polymorphic documents (refs #4279)
add test for gettdoc functions (refs #4279)
Merge pull request #1013 from Eric-Brison/3.2-I4279

correct gettdoc functions for polymorphic documents (closes #4279)