From 3431e9815b777434bff5a517e2c7158e75bc45e4 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sun, 23 Nov 2008 23:43:58 +0000 Subject: [PATCH] BUGFIX Removed hacky code setting fields in the SearchForm constructor BUGFIX Removed SearchForm->FormMethod() and used $this->setFormMethod() in SearchForm constructor instead which is a nicer solution instead of overloading a Form method git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66431 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- search/SearchForm.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/search/SearchForm.php b/search/SearchForm.php index 66c7faf52..b88120277 100755 --- a/search/SearchForm.php +++ b/search/SearchForm.php @@ -45,25 +45,14 @@ class SearchForm extends Form { ); } - // We need this because it's a get form. It can't go in the action value - // Hayden: Sorry if I've got it mixed up, but on the results or not found pages, the - // RelativeLink seems to be empty and it packs a sad - $formController = isset($_GET['formController']) ? $_GET['formController'] : null; - if(!$formController) $formController = $controller->RelativeLink(); - - $fields->push(new HiddenField('formController', null, $formController)); - $fields->push(new HiddenField('executeForm', null, $name)); - parent::__construct($controller, $name, $fields, $actions); + $this->setFormMethod('get'); + $this->disableSecurityToken(); } - function FormMethod() { - return "get"; - } - - public function forTemplate(){ + public function forTemplate() { return $this->renderWith(array( 'SearchForm', 'Form'