mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIXED: Bug in GridFieldAddExistingAutocompleter.php where an uninitialised variable would occasionally crash searches
REMOVED: Unused variable
This commit is contained in:
parent
1432a8e8a1
commit
d172e160a8
@ -172,14 +172,8 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
|
||||
* @param SS_HTTPRequest $request
|
||||
*/
|
||||
public function doSearch($gridField, $request) {
|
||||
if($this->searchList) {
|
||||
$allList = $this->searchList;
|
||||
} else {
|
||||
$allList = DataList::create($gridField->getList()->dataClass());
|
||||
}
|
||||
|
||||
$filters = array();
|
||||
$stmts = array();
|
||||
$dataClass = $gridField->getList()->dataClass();
|
||||
$allList = $this->searchList ? $this->searchList : DataList::create($dataClass);
|
||||
|
||||
$searchFields = ($this->getSearchFields()) ? $this->getSearchFields() : $this->scaffoldSearchFields($dataClass);
|
||||
if(!$searchFields) {
|
||||
@ -189,6 +183,7 @@ class GridFieldAddExistingAutocompleter implements GridField_HTMLProvider, GridF
|
||||
}
|
||||
|
||||
// TODO Replace with DataList->filterAny() once it correctly supports OR connectives
|
||||
$stmts = array();
|
||||
foreach($searchFields as $searchField) {
|
||||
$stmts[] .= sprintf('"%s" LIKE \'%s%%\'', $searchField, Convert::raw2sql($request->getVar('gridfield_relationsearch')));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user