From 1bb993b0b3a740001676787bca9273f1d4983d43 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 18 Sep 2013 13:55:30 +0200 Subject: [PATCH] Form errors in LeftAndMain response negotiation The session key for form errors changed from "Form_EditForm" to "CMSForm_EditForm", causing a mismatch. See https://github.com/silverstripe/silverstripe-framework/pull/2084/files#r6338249 for discussion --- admin/code/CMSForm.php | 5 +++++ forms/Form.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/admin/code/CMSForm.php b/admin/code/CMSForm.php index 467e1e477..2cc33807e 100644 --- a/admin/code/CMSForm.php +++ b/admin/code/CMSForm.php @@ -37,4 +37,9 @@ class CMSForm extends Form { return $this->responseNegotiator; } + public function FormName() { + if($this->htmlID) return $this->htmlID; + else return 'Form_' . str_replace(array('.', '/'), '', $this->name); + } + } \ No newline at end of file diff --git a/forms/Form.php b/forms/Form.php index 4dd0f84f2..ae223abb3 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -241,6 +241,8 @@ class Form extends RequestHandler { if(isset($errorInfo['message']) && isset($errorInfo['type'])) { $this->setMessage($errorInfo['message'], $errorInfo['type']); } + + return $this; } /**