From fbac34c7c71f6db20792a51dbc4c575d768dafb2 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Thu, 30 Apr 2009 23:03:03 +0000 Subject: [PATCH] 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 --- code/sitefeatures/PageCommentInterface.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/sitefeatures/PageCommentInterface.php b/code/sitefeatures/PageCommentInterface.php index 9a78efe2..aab59ffc 100755 --- a/code/sitefeatures/PageCommentInterface.php +++ b/code/sitefeatures/PageCommentInterface.php @@ -153,6 +153,9 @@ class PageCommentInterface extends RequestHandler { 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. if(class_exists('SpamProtecterManager')) { // 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::redirectBack(); // worst case, just go back to the page } }