BUGFIX: set when ajax is disabled for commenting that we redirect manually down to the comment form

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@75785 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2009-04-30 23:03:03 +00:00 committed by Sam Minnee
parent 820d6b92cd
commit fbac34c7c7

View File

@ -153,6 +153,9 @@ class PageCommentInterface extends RequestHandler {
new FormAction("postcomment", _t('PageCommentInterface.POST', 'Post')) new FormAction("postcomment", _t('PageCommentInterface.POST', 'Post'))
)); ));
// Set it so the user gets redirected back down to the form upon form fail
$form->setRedirectToFormOnValidationError(true);
// Optional Spam Protection. // Optional Spam Protection.
if(class_exists('SpamProtecterManager')) { if(class_exists('SpamProtecterManager')) {
// Update the form to add the protecter field to it // Update the form to add the protecter field to it
@ -297,6 +300,7 @@ class PageCommentInterface_Form extends Form {
return Director::redirect(Director::baseURL(). $page->URLSegment.'#PageComment_'.$comment->ID); return Director::redirect(Director::baseURL(). $page->URLSegment.'#PageComment_'.$comment->ID);
} }
} }
return Director::redirectBack(); // worst case, just go back to the page return Director::redirectBack(); // worst case, just go back to the page
} }
} }