BUG Fix incorrect search form

This commit is contained in:
Damian Mooyman 2016-09-23 14:48:55 +12:00
parent 6524d60f75
commit ffe85db33f
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
2 changed files with 2 additions and 20 deletions

View File

@ -35,7 +35,8 @@ class ContentControllerSearchExtension extends Extension {
$actions = new FieldList(
new FormAction('results', _t('SearchForm.GO', 'Go'))
);
$form = SearchForm::create($this->owner, 'SilverStripe\\CMS\\Search\\SearchForm', $fields, $actions);
/** @skipUpgrade */
$form = SearchForm::create($this->owner, 'SearchForm', $fields, $actions);
$form->classesToSearch(FulltextSearchable::get_searchable_classes());
return $form;
}

View File

@ -78,25 +78,6 @@ class SearchForm extends Form {
$this->disableSecurityToken();
}
/**
* Return a rendered version of this form.
*
* This is returned when you access a form as $FormObject rather
* than <% with FormObject %>
*/
public function forTemplate() {
$return = $this->renderWith(array_merge(
(array)$this->getTemplate(),
array('SilverStripe\\CMS\\Search\\SearchForm', 'SilverStripe\\Forms\\Form')
));
// Now that we're rendered, clear message
$this->clearMessage();
return $return;
}
/**
* Set the classes to search.
* Currently you can only choose from "SiteTree" and "File", but a future version might improve this.