mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
820d6b92cd
commit
fbac34c7c7
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user