]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16075 fixed incomplete conversion of glossary comments
authorskodak <skodak>
Tue, 14 Jul 2009 08:26:45 +0000 (08:26 +0000)
committerskodak <skodak>
Tue, 14 Jul 2009 08:26:45 +0000 (08:26 +0000)
mod/glossary/comment.php

index 66a1c1237eb2c4c35fb5ae96b2b9bc1412cffedb..f774b0d22140afac8ac4ee3d55219e85857cb592 100644 (file)
@@ -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&amp;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&amp;eid=$entry->id", "$newcomment->id", $cm->id);
-        redirect("comments.php?id=$cm->id&amp;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&amp;eid=$entry->id", "$updatedcomment->id",$cm->id);
 
-        redirect("comments.php?id=$cm->id&amp;eid=$entry->id");
+        redirect("comments.php?id=$cm->id&eid=$entry->id");
 
     } else {
         glossary_comment_print_header($course, $cm, $glossary, $entry, 'edit');