mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR FIX: columns quoted properly
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86529 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
69563972e5
commit
90f2f13267
@ -177,7 +177,7 @@ abstract class SearchFilter extends Object {
|
|||||||
$ancestry = array_reverse($ancestry);
|
$ancestry = array_reverse($ancestry);
|
||||||
foreach($ancestry as $ancestor){
|
foreach($ancestry as $ancestor){
|
||||||
if($ancestor != $component){
|
if($ancestor != $component){
|
||||||
$query->innerJoin($ancestor, "\"$component\".\"ID\" = \"$ancestor\".ID");
|
$query->innerJoin($ancestor, "\"$component\".\"ID\" = \"$ancestor\".\"ID\"");
|
||||||
$component=$ancestor;
|
$component=$ancestor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ abstract class SearchFilter extends Object {
|
|||||||
$ancestry = array_reverse($ancestry);
|
$ancestry = array_reverse($ancestry);
|
||||||
foreach($ancestry as $ancestor){
|
foreach($ancestry as $ancestor){
|
||||||
if($ancestor != $component){
|
if($ancestor != $component){
|
||||||
$query->innerJoin($ancestor, "\"$component\".\"ID\" = \"$ancestor\".ID");
|
$query->innerJoin($ancestor, "\"$component\".\"ID\" = \"$ancestor\".\"ID\"");
|
||||||
$component=$ancestor;
|
$component=$ancestor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,10 +223,11 @@ abstract class SearchFilter extends Object {
|
|||||||
$newQuery = $model->{"{$rel}Query"}();
|
$newQuery = $model->{"{$rel}Query"}();
|
||||||
if($newQuery) {
|
if($newQuery) {
|
||||||
// Get the table to join to
|
// Get the table to join to
|
||||||
|
//DATABASE ABSTRACTION: I don't think we need this line anymore:
|
||||||
$newModel = str_replace('`','',array_shift($newQuery->from));
|
$newModel = str_replace('`','',array_shift($newQuery->from));
|
||||||
// Get the filter to use on the join
|
// Get the filter to use on the join
|
||||||
$ancestry = $model->getClassAncestry();
|
$ancestry = $model->getClassAncestry();
|
||||||
$newFilter = "(" . str_replace('$ID', "`{$ancestry[0]}`.`ID`" , implode(") AND (", $newQuery->where) ) . ")";
|
$newFilter = "(" . str_replace('$ID', "\"{$ancestry[0]}\".\"ID\"" , implode(") AND (", $newQuery->where) ) . ")";
|
||||||
$query->leftJoin($newModel, $newFilter);
|
$query->leftJoin($newModel, $newFilter);
|
||||||
$this->model = $newModel;
|
$this->model = $newModel;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user