Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FIXED: Bug in GridFieldAddExistingAutocompleter.php where an uninitia…

…lised variable would occasionally crash searches

REMOVED: Unused variable
  • Loading branch information...
commit d172e160a871a0c47107fe73b112a19b97dac75f 1 parent 1432a8e
@tractorcow tractorcow authored
Showing with 3 additions and 8 deletions.
  1. +3 −8 forms/gridfield/GridFieldAddExistingAutocompleter.php
View
11 forms/gridfield/GridFieldAddExistingAutocompleter.php
@@ -172,14 +172,8 @@ public function getURLHandlers($gridField) {
* @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 @@ public function doSearch($gridField, $request) {
}
// 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')));
}
Please sign in to comment.
Something went wrong with that request. Please try again.