mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-16075 fixed incomplete conversion of glossary comments
This commit is contained in:
parent
7f0fedc0b5
commit
4e94ce8ec5
@ -56,12 +56,12 @@ function glossary_comment_add() {
|
||||
|
||||
$comment = new object();
|
||||
$comment->id = null;
|
||||
$comment->action = 'edit';
|
||||
$comment->action = 'add';
|
||||
$comment->entryid = $entry->id;
|
||||
|
||||
$comment = file_prepare_standard_editor($comment, 'entrycomment', $commentoptions, $context);
|
||||
|
||||
$mform = new mod_glossary_comment_form(array('current'=>$comment, 'commentoptions'=>$commentoptions));
|
||||
$mform = new mod_glossary_comment_form(null, array('current'=>$comment, 'commentoptions'=>$commentoptions));
|
||||
|
||||
if ($mform->is_cancelled()) {
|
||||
redirect("comments.php?id=$cm->id&eid=$entry->id");
|
||||
@ -69,14 +69,14 @@ function glossary_comment_add() {
|
||||
|
||||
if ($newcomment = $mform->get_data()) {
|
||||
|
||||
$newcomment = file_postupdate_standard_editor($newcomment, 'entrycomment', $newcommentoptions, $context);//no files - can be used before insert
|
||||
$newcomment = file_postupdate_standard_editor($newcomment, 'entrycomment', $commentoptions, $context);//no files - can be used before insert
|
||||
$newcomment->timemodified = time();
|
||||
$newcomment->userid = $USER->id;
|
||||
|
||||
$newcomment->id = $DB->insert_record('glossary_comments', $newcomment);
|
||||
|
||||
add_to_log($course->id, 'glossary', 'add comment', "comments.php?id=$cm->id&eid=$entry->id", "$newcomment->id", $cm->id);
|
||||
redirect("comments.php?id=$cm->id&eid=$entry->id");
|
||||
redirect("comments.php?id=$cm->id&eid=$entry->id");
|
||||
|
||||
} else {
|
||||
glossary_comment_print_header($course, $cm, $glossary, $entry, 'add');
|
||||
@ -182,7 +182,7 @@ function glossary_comment_edit() {
|
||||
$comment->action = 'edit';
|
||||
$comment = file_prepare_standard_editor($comment, 'entrycomment', $commentoptions, $context);
|
||||
|
||||
$mform = new mod_glossary_comment_form(array('current'=>$comment, 'commentoptions'=>$commentoptions));
|
||||
$mform = new mod_glossary_comment_form(null, array('current'=>$comment, 'commentoptions'=>$commentoptions));
|
||||
|
||||
if ($updatedcomment = $mform->get_data()) {
|
||||
|
||||
@ -192,7 +192,7 @@ function glossary_comment_edit() {
|
||||
$DB->update_record('glossary_comments', $updatedcomment);
|
||||
add_to_log($course->id, 'glossary', 'update comment', "comments.php?id=$cm->id&eid=$entry->id", "$updatedcomment->id",$cm->id);
|
||||
|
||||
redirect("comments.php?id=$cm->id&eid=$entry->id");
|
||||
redirect("comments.php?id=$cm->id&eid=$entry->id");
|
||||
|
||||
} else {
|
||||
glossary_comment_print_header($course, $cm, $glossary, $entry, 'edit');
|
||||
|
Loading…
x
Reference in New Issue
Block a user