Fixed #23455 -- Accept either bytes or text for related_name, convert to text.