Since Moodle 3.9 is now stable, too late for an answer. I think the solution prior to 15 June would have been https://moodle.org/mod/forum/discuss.php?d=403280#p1627774 with further explanations in https://moodle.org/mod/forum/discuss.php?d=403280#p1628105.
General developer forum
Git : Pulling Moodle 39 Dev
This discussion has been locked so you can no longer reply to it.