correct getLatestId when document revision not comes from same family (refs #4216)