"MDL-14129, fix print_error call"
This commit is contained in:
@@ -15,16 +15,16 @@
|
||||
|
||||
|
||||
if (! $record = get_record('data_records', 'id', $rid)) {
|
||||
print_error('Record ID is incorrect');
|
||||
print_error('invalidrecord', 'data');
|
||||
}
|
||||
if (! $data = get_record('data', 'id', $record->dataid)) {
|
||||
print_error('Data ID is incorrect');
|
||||
print_error('invalidid', 'data');
|
||||
}
|
||||
if (! $course = get_record('course', 'id', $data->course)) {
|
||||
print_error('Course is misconfigured');
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance('data', $data->id, $course->id)) {
|
||||
print_error('Course Module ID was incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
@@ -33,13 +33,13 @@
|
||||
|
||||
if ($commentid) {
|
||||
if (! $comment = get_record('data_comments', 'id', $commentid)) {
|
||||
print_error('Comment ID is misconfigured');
|
||||
print_error('commentmisconf');
|
||||
}
|
||||
if ($comment->recordid != $record->id) {
|
||||
print_error('Comment ID is misconfigured');
|
||||
print_error('commentmisconf');
|
||||
}
|
||||
if (!has_capability('mod/data:managecomments', $context) && $comment->userid != $USER->id) {
|
||||
print_error('Comment is not yours to edit!');
|
||||
print_error('cannoteditcomment');
|
||||
}
|
||||
} else {
|
||||
$comment = false;
|
||||
@@ -81,7 +81,7 @@
|
||||
if (insert_record('data_comments',$newcomment)) {
|
||||
redirect('view.php?rid='.$record->id.'&page='.$page);
|
||||
} else {
|
||||
print_error('Error while saving comment.');
|
||||
print_error('cannotsavecomment');
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -100,7 +100,7 @@
|
||||
if (update_record('data_comments',$updatedcomment)) {
|
||||
redirect('view.php?rid='.$record->id.'&page='.$page);
|
||||
} else {
|
||||
print_error('Error while saving comment.');
|
||||
print_error('cannotsavecomment');
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user