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
This commit is contained in:
Sean Harvey 2008-11-23 23:43:58 +00:00 committed by Sam Minnee
parent 07e9aaa547
commit 3431e9815b

View File

@ -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'