mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUG Fix incorrect search form
This commit is contained in:
parent
6524d60f75
commit
ffe85db33f
@ -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;
|
||||
}
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user