From: skodak Date: Thu, 29 Jun 2006 06:48:31 +0000 (+0000) Subject: Bug #5960 - can't delete or edit comments; merged from MOODLE_16_STABLE X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=036c0fcb1a97a0087c9e3df1046fdb7aa2369f8a;p=moodle.git Bug #5960 - can't delete or edit comments; merged from MOODLE_16_STABLE --- diff --git a/mod/data/comment.php b/mod/data/comment.php index 594caaf20f..28ec4b9e2f 100755 --- a/mod/data/comment.php +++ b/mod/data/comment.php @@ -1,4 +1,4 @@ -id.'&page='.$page, get_string('commentempty', 'data')); - } - switch ($mode) { case 'add': + if (empty($commentcontent)) { + redirect('view.php?rid='.$record->id.'&page='.$page, get_string('commentempty', 'data')); + } + $newcomment = new object; $newcomment->userid = $USER->id; $newcomment->created = time(); @@ -75,6 +74,10 @@ break; case 'editcommit': //update db + if (empty($commentcontent)) { + redirect('view.php?rid='.$record->id.'&page='.$page, get_string('commentempty', 'data')); + } + if ($comment) { $newcomment = new object; $newcomment->id = $comment->id;