MDL-46458 forum: External function get_forum_discussions rewritten