From 036c0fcb1a97a0087c9e3df1046fdb7aa2369f8a Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 29 Jun 2006 06:48:31 +0000 Subject: [PATCH] Bug #5960 - can't delete or edit comments; merged from MOODLE_16_STABLE --- mod/data/comment.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mod/data/comment.php b/mod/data/comment.php index 594caaf20f6..28ec4b9e2f4 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;