MDL-70731 mod_forum: Fix moodle_exception error messages

This commit is contained in:
Jun Pataleta
2022-03-31 22:51:16 +08:00
parent 3ab09c775d
commit 2a606b6a10
2 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -45,14 +45,14 @@ $discussionvault = $vaultfactory->get_discussion_vault();
$discussion = $discussionvault->get_from_id($d);
if (!$discussion) {
throw new \moodle_exception('Unable to find discussion with id ' . $discussionid);
throw new \moodle_exception('errordiscussionnotfound', 'mod_forum');
}
$forumvault = $vaultfactory->get_forum_vault();
$forum = $forumvault->get_from_id($discussion->get_forum_id());
if (!$forum) {
throw new \moodle_exception('Unable to find forum with id ' . $discussion->get_forum_id());
throw new \moodle_exception('errorforumnotfound', 'mod_forum');
}
$course = $forum->get_course_record();
+3 -1
View File
@@ -258,11 +258,13 @@ $string['emaildigesttype_help'] = 'The type of notification that you will receiv
* Digest - subjects only - you will receive one digest e-mail per day containing just the subject of each forum post.
';
$string['emptymessage'] = 'Something was wrong with your post. Perhaps you left it blank, or the attachment was too big. Your changes have NOT been saved.';
$string['errorcannotlock'] = 'You do not have the permission to lock discussions.';
$string['errordiscussionnotfound'] = 'The discussion was not found';
$string['erroremptymessage'] = 'Post message cannot be empty';
$string['erroremptysubject'] = 'Post subject cannot be empty.';
$string['errorenrolmentrequired'] = 'You must be enrolled in this course to access this content';
$string['errorforumnotfound'] = 'The forum that this discussion belongs to was not found';
$string['errorwhiledelete'] = 'An error occurred while deleting record.';
$string['errorcannotlock'] = 'You do not have the permission to lock discussions.';
$string['eventassessableuploaded'] = 'Some content has been posted.';
$string['everyonecanchoose'] = 'Everyone can choose to be subscribed';
$string['everyonecannowchoose'] = 'Everyone can now choose to be subscribed';