mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
07e9aaa547
commit
3431e9815b
@ -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);
|
parent::__construct($controller, $name, $fields, $actions);
|
||||||
|
|
||||||
|
$this->setFormMethod('get');
|
||||||
|
|
||||||
$this->disableSecurityToken();
|
$this->disableSecurityToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
function FormMethod() {
|
public function forTemplate() {
|
||||||
return "get";
|
|
||||||
}
|
|
||||||
|
|
||||||
public function forTemplate(){
|
|
||||||
return $this->renderWith(array(
|
return $this->renderWith(array(
|
||||||
'SearchForm',
|
'SearchForm',
|
||||||
'Form'
|
'Form'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user