diff --git a/mod/forum/discuss.php b/mod/forum/discuss.php index e33b7554f7b..09c747a4310 100644 --- a/mod/forum/discuss.php +++ b/mod/forum/discuss.php @@ -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(); diff --git a/mod/forum/lang/en/forum.php b/mod/forum/lang/en/forum.php index fc9447665ab..ad21298a737 100644 --- a/mod/forum/lang/en/forum.php +++ b/mod/forum/lang/en/forum.php @@ -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';