From 014f541a89060f125a4ad8731d116c91766c0e4d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 15 Jan 2013 14:25:07 +0100 Subject: [PATCH] BUG Regression in Form->clearMessage() (fixes #8186) See 729bcc9 --- forms/Form.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/forms/Form.php b/forms/Form.php index 5ce1ea304..631814c60 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -1319,17 +1319,15 @@ class Form extends RequestHandler { * than <% control FormObject %> */ public function forTemplate() { - return $this->renderWith(array_merge( - (array)$this->getTemplate(), - array('Form') - )); - // Now that we're rendered, clear message Session::clear("FormInfo.{$this->FormName()}.errors"); Session::clear("FormInfo.{$this->FormName()}.formError"); Session::clear("FormInfo.{$this->FormName()}.data"); - - return $result; + + return $this->renderWith(array_merge( + (array)$this->getTemplate(), + array('Form') + )); } /**