diff --git a/blog/index.php b/blog/index.php index 77476a98242..c0084277d13 100644 --- a/blog/index.php +++ b/blog/index.php @@ -143,7 +143,7 @@ if (!empty($groupid)) { } if (!$course = $DB->get_record('course', array('id'=>$group->courseid))) { - print_error(get_string('invalidcourseid', 'blog')); + print_error('invalidcourseid'); } $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); diff --git a/course/delete.php b/course/delete.php index ba9c3be0b72..ebe6b788e7d 100644 --- a/course/delete.php +++ b/course/delete.php @@ -18,11 +18,11 @@ $strcategories = get_string("categories"); if (! $course = $DB->get_record("course", array("id"=>$id))) { - print_error("invalidcourseid", 'error', '', $id); + print_error("invalidcourseid"); } if ($site->id == $course->id) { // can not delete frontpage! - print_error("invalidcourseid", 'error', '', $id); + print_error("invalidcourseid"); } $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); diff --git a/course/externallib.php b/course/externallib.php index 41c5ab4fce9..bf43d2bb025 100644 --- a/course/externallib.php +++ b/course/externallib.php @@ -722,7 +722,7 @@ class core_course_external extends external_api { // Context validation. if (! ($course = $DB->get_record('course', array('id'=>$params['courseid'])))) { - throw new moodle_exception('invalidcourseid', 'error', '', $params['courseid']); + throw new moodle_exception('invalidcourseid', 'error'); } // Category where duplicated course is going to be created. diff --git a/enrol/authorize/index.php b/enrol/authorize/index.php index 5bdee1851a0..7b93b042b9f 100644 --- a/enrol/authorize/index.php +++ b/enrol/authorize/index.php @@ -53,7 +53,7 @@ /// Get course if (!($course = $DB->get_record('course', array('id'=>$courseid)))) { - print_error('invalidcourseid', '', '', $courseid); + print_error('invalidcourseid'); } /// Only SITE users can access to this page diff --git a/lang/en/error.php b/lang/en/error.php index b40859b4e18..7ad032cec31 100644 --- a/lang/en/error.php +++ b/lang/en/error.php @@ -280,7 +280,7 @@ $string['invalidcomponent'] = 'Invalid component name'; $string['invalidconfirmdata'] = 'Invalid confirmation data'; $string['invalidcontext'] = 'Invalid context'; $string['invalidcourse'] = 'Invalid course'; -$string['invalidcourseid'] = 'You are trying to use an invalid course ID: ({$a})'; +$string['invalidcourseid'] = 'You are trying to use an invalid course ID'; $string['invalidcourselevel'] = 'Incorrect context level'; $string['invalidcoursemodule'] = 'Invalid course module ID'; $string['invalidcoursenameshort'] = 'Invalid short course name'; diff --git a/lang/en/notes.php b/lang/en/notes.php index 49dbf0e38dd..bffe068c6ea 100644 --- a/lang/en/notes.php +++ b/lang/en/notes.php @@ -37,7 +37,6 @@ $string['deletenotes'] = 'Delete all notes'; $string['editnote'] = 'Edit note'; $string['enablenotes'] = 'Enable notes'; $string['groupaddnewnote'] = 'Add a common note'; -$string['invalidcourseid'] = 'Invalid course id: {$a}'; $string['invalidid'] = 'Invalid note ID specified'; $string['invaliduserid'] = 'Invalid user id: {$a}'; $string['nocontent'] = 'Note content can not be empty'; diff --git a/mod/data/export.php b/mod/data/export.php index 3040ef66424..40fc89430bb 100644 --- a/mod/data/export.php +++ b/mod/data/export.php @@ -41,7 +41,7 @@ if (! $cm = get_coursemodule_from_instance('data', $data->id, $data->course)) { } if(! $course = $DB->get_record('course', array('id'=>$cm->course))) { - print_error('invalidcourseid', '', '', $cm->course); + print_error('invalidcourseid'); } // fill in missing properties needed for updating of instance diff --git a/notes/externallib.php b/notes/externallib.php index fc31e9bb8fb..f6710426910 100644 --- a/notes/externallib.php +++ b/notes/externallib.php @@ -110,7 +110,7 @@ class core_notes_external extends external_api { //check the course exists if (empty($courses[$note['courseid']])) { $success = false; - $errormessage = get_string('invalidcourseid', 'notes', $note['courseid']); + $errormessage = get_string('invalidcourseid', 'error'); } else { // Ensure the current user is allowed to run this function $context = get_context_instance(CONTEXT_COURSE, $note['courseid']);