diff --git a/enrol/flatfile/lib.php b/enrol/flatfile/lib.php index 3c839d0854c..7e018251cd2 100644 --- a/enrol/flatfile/lib.php +++ b/enrol/flatfile/lib.php @@ -151,7 +151,7 @@ class enrol_flatfile_plugin extends enrol_plugin { if(! @unlink($filename)) { $eventdata = new stdClass(); $eventdata->modulename = 'moodle'; - $eventdata->component = 'course'; + $eventdata->component = 'enrol_flatfile'; $eventdata->name = 'flatfile_enrolment'; $eventdata->userfrom = get_admin(); $eventdata->userto = get_admin(); @@ -169,7 +169,7 @@ class enrol_flatfile_plugin extends enrol_plugin { // Send mail to admin $eventdata = new stdClass(); $eventdata->modulename = 'moodle'; - $eventdata->component = 'course'; + $eventdata->component = 'enrol_flatfile'; $eventdata->name = 'flatfile_enrolment'; $eventdata->userfrom = get_admin(); $eventdata->userto = get_admin(); @@ -280,7 +280,7 @@ class enrol_flatfile_plugin extends enrol_plugin { $eventdata = new stdClass(); $eventdata->modulename = 'moodle'; - $eventdata->component = 'course'; + $eventdata->component = 'enrol_flatfile'; $eventdata->name = 'flatfile_enrolment'; $eventdata->userfrom = $teacher; $eventdata->userto = $user; @@ -303,7 +303,7 @@ class enrol_flatfile_plugin extends enrol_plugin { $eventdata = new stdClass(); $eventdata->modulename = 'moodle'; - $eventdata->component = 'course'; + $eventdata->component = 'enrol_flatfile'; $eventdata->name = 'flatfile_enrolment'; $eventdata->userfrom = $user; $eventdata->userto = $teacher; diff --git a/lang/en/message.php b/lang/en/message.php index 5594c8ccd57..1a2c7514a4a 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -40,7 +40,6 @@ $string['blocknoncontacts'] = 'Prevent non-contacts from messaging me'; $string['contactlistempty'] = 'Your contact list is empty'; $string['contacts'] = 'Contacts'; $string['context'] = 'context'; -$string['couldnotfindpreference'] = 'Could not load preference {$a}. Does the component and name you supplied to message_send() match a row in message_providers? Message providers must appear in the database so users can configure how they will be notified when they receive messages.'; $string['defaultmessageoutputs'] = 'Default message outputs'; $string['defaults'] = 'Defaults'; $string['deletemessagesdays'] = 'Number of days before old messages are automatically deleted'; diff --git a/lib/messagelib.php b/lib/messagelib.php index 3ab00ead83b..d4641068ae8 100644 --- a/lib/messagelib.php +++ b/lib/messagelib.php @@ -155,10 +155,11 @@ function message_send($eventdata) { 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', $defaultpreference); - throw new coding_exception($preferrormsg,'blah'); + // 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 = "Could not load preference $defaultpreference. Make sure the component and name you supplied + to message_send() are valid."; + throw new coding_exception($preferrormsg); } // Find out if user has configured this output