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
This commit is contained in:
Sam Minnee 2010-10-19 01:03:49 +00:00
parent 2ae76958bb
commit f124be7f95

View File

@ -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);