Fix 'add activity...' not working

As reported on https://moodle.org/mod/forum/discuss.php?d=231970#p1010505