mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX #6304 PageCommentInterface::PostCommentForm() loads inappropriate data from cookie, including wrong values for ParentID
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@115399 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
25de6303a8
commit
3b6a9579d4
@ -216,8 +216,13 @@ class PageCommentInterface extends RequestHandler {
|
|||||||
$this->extend('updatePageCommentForm', $form);
|
$this->extend('updatePageCommentForm', $form);
|
||||||
|
|
||||||
// Load the users data from a cookie
|
// Load the users data from a cookie
|
||||||
if($cookie = Cookie::get("PageCommentInterface_Data")) {
|
$cookie = Cookie::get('PageCommentInterface_Data');
|
||||||
$form->loadDataFrom(unserialize($cookie));
|
if($cookie) {
|
||||||
|
$visibleFields = array();
|
||||||
|
foreach($fields as $field) {
|
||||||
|
if(!$field instanceof HiddenField) $visibleFields[] = $field->Name();
|
||||||
|
}
|
||||||
|
$form->loadDataFrom(unserialize($cookie), false, $visibleFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
Loading…
Reference in New Issue
Block a user