BUGFIX #3798 ajshort: Let searchcontext be used on sitetree

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@73758 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-03-29 20:29:36 +00:00
parent 2964cb625d
commit 6c2b2c2e67
2 changed files with 4 additions and 3 deletions

View File

@ -108,7 +108,7 @@ class SearchContext extends Object {
if($existingQuery) {
$query = $existingQuery;
} else {
$query = $model->extendedSQL();
$query = $model->buildSQL();
}
$SQL_limit = Convert::raw2sql($limit);
@ -137,10 +137,11 @@ class SearchContext extends Object {
}
}
$query->connective = $this->connective;
$query->distinct = true;
$model->extend('augmentSQL', $query);
return $query;
}

View File

@ -94,7 +94,7 @@ abstract class SearchFilter extends Object {
}
if($candidateClass == 'DataObject') user_error("Couldn't find field $this->name in any of $this->model's tables.", E_USER_ERROR);
return $candidateClass . "." . $this->name;
return "`$candidateClass`.`$this->name`";
}
/**