mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
message MDL-25114 tried to provide a more helpful error message for when code sending a message supplied an unknown component or event name
This commit is contained in:
parent
c8fdd86791
commit
60dd7688a8
2 changed files with 7 additions and 0 deletions
|
@ -115,6 +115,12 @@ function message_send($eventdata) {
|
|||
print_error('cannotsavemessageprefs', 'message');
|
||||
}
|
||||
$processor = get_user_preferences($preferencename, NULL, $eventdata->userto->id);
|
||||
if (empty($processor)) {
|
||||
//this means they supplied an $eventdata->component $eventdata->name combination which doesn't
|
||||
//exist in the message_provider table
|
||||
$preferrormsg = get_string('couldnotfindpreference', 'message', $preferencename);
|
||||
throw new coding_exception($preferrormsg);
|
||||
}
|
||||
}
|
||||
|
||||
if ($processor=='none' && $savemessage->notification) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue