From f124be7f950a63c17b3a105590f0c8f4708cb0ec Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 19 Oct 2010 01:03:49 +0000 Subject: [PATCH] BUGFIX: added validation to the page comment form Fixes #2782 (from r111452) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112803 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/sitefeatures/PageCommentInterface.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/sitefeatures/PageCommentInterface.php b/code/sitefeatures/PageCommentInterface.php index 4d53eb21..938ffadb 100755 --- a/code/sitefeatures/PageCommentInterface.php +++ b/code/sitefeatures/PageCommentInterface.php @@ -194,8 +194,7 @@ class PageCommentInterface extends RequestHandler { $fields->push(new TextareaField("Comment", _t('PageCommentInterface.YOURCOMMENT', "Comments"))); $form = new PageCommentInterface_Form($this, "PostCommentForm", $fields, new FieldSet( - new FormAction("postcomment", _t('PageCommentInterface.POST', 'Post')) - )); + new FormAction("postcomment", _t('PageCommentInterface.POST', 'Post'))), new RequiredFields('Name', 'Comment')); // Set it so the user gets redirected back down to the form upon form fail $form->setRedirectToFormOnValidationError(true);