Good work with the patch - to me although it seems a bit unclear whether it will actually be merged into 3.2 since the code change is for the 2.9 branch or whether anyone are working on providing the required unit tests?
Thanks Tue. The patch is actually based on the master branch and is regularly rebased, so if you wanted to cherry-pick it after the release of Moodle 3.2 it should merge cleanly. Unfortunately it won't be integrated in time for the 3.2 release as I haven't had time to create the tests yet (and won't for quite a while) and the codebase is about to be frozen for pre-release testing.