Fix Moodle 2.6 upgrade as per https://moodle.org/mod/forum/discuss.php?d=243679#p1057801.