The solutions suggested on the http://moodle.org/mod/forum/discuss.php?d=184927 did not work for me. I needed to get our students imported for the new semester, so I tracked down the buggy line of code. It's in /lib/messagelib.php lines 127-134:
if (isset($defaultpreferences->{$defaultpreference})) {
$permitted = $defaultpreferences->{$defaultpreference};
} else {
//MDL-25114 They supplied an $eventdata->component $eventdata->name combination which doesn't
//exist in the message_provider table (thus there is no default settings for them)
$preferrormsg = get_string('couldnotfindpreference', 'message', $preferencename); //TODO: undefined $preferencename
//MIAD CHANGE MIAD CHANGE
//echo the eventdata info and wrap the exception in an if to permit flatfile enrolments
echo "\n component: ".$eventdata->component."\n name: ".$eventdata->name."\n" ;
if ($eventdata->name != "flatfile_enrolment"){
throw new coding_exception($preferrormsg,'blah');
}
}
I changed it to:
if (isset($defaultpreferences->{$defaultpreference})) {
$permitted = $defaultpreferences->{$defaultpreference};
} else {
//MDL-25114 They supplied an $eventdata->component $eventdata->name combination which doesn't
//exist in the message_provider table (thus there is no default settings for them)
$preferrormsg = get_string('couldnotfindpreference', 'message', $preferencename); //TODO: undefined $preferencename
// wrap the exception in an if to permit flatfile enrolment
if ($eventdata->name != "flatfile_enrolment"){
throw new coding_exception($preferrormsg,'blah');
}
}
It also works if you just comment out the coding_exception line:
//throw new coding_exception($preferrormsg,'blah');
But I figured it was safer to wrap it in an if statement, in case this snippet gets called in some situation where it works.