mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fixed ORM bugs introduced in ec55468932
This commit is contained in:
parent
64aa2ad170
commit
5499079c1c
@ -2942,8 +2942,8 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
|
|
||||||
// Build index list
|
// Build index list
|
||||||
$manymanyIndexes = array(
|
$manymanyIndexes = array(
|
||||||
"\"{$this->class}ID\"" => true,
|
"{$this->class}ID" => true,
|
||||||
(($this->class == $childClass) ? "ChildID" : "\"{$childClass}ID\"") => true,
|
(($this->class == $childClass) ? "ChildID" : "{$childClass}ID") => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
DB::requireTable("{$this->class}_$relationship", $manymanyFields, $manymanyIndexes, true, null, $extensions);
|
DB::requireTable("{$this->class}_$relationship", $manymanyFields, $manymanyIndexes, true, null, $extensions);
|
||||||
|
@ -199,8 +199,8 @@ class DataQuery {
|
|||||||
$collisionBase = $matches[1];
|
$collisionBase = $matches[1];
|
||||||
$collisionClasses = ClassInfo::subclassesFor($collisionBase);
|
$collisionClasses = ClassInfo::subclassesFor($collisionBase);
|
||||||
$collisionClasses = array_map(array(DB::getConn(), 'prepStringForDB'), $collisionClasses);
|
$collisionClasses = array_map(array(DB::getConn(), 'prepStringForDB'), $collisionClasses);
|
||||||
$caseClauses[] = "WHEN \"$baseClass\".\"ClassName\" IN ('"
|
$caseClauses[] = "WHEN \"$baseClass\".\"ClassName\" IN ("
|
||||||
. implode("', '", $collisionClasses) . "') THEN $collision";
|
. implode(", ", $collisionClasses) . ") THEN $collision";
|
||||||
} else {
|
} else {
|
||||||
user_error("Bad collision item '$collision'", E_USER_WARNING);
|
user_error("Bad collision item '$collision'", E_USER_WARNING);
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ class DataQuery {
|
|||||||
$classNames = ClassInfo::subclassesFor($this->dataClass);
|
$classNames = ClassInfo::subclassesFor($this->dataClass);
|
||||||
if(!$classNames) user_error("DataList::create() Can't find data sub-classes for '$callerClass'");
|
if(!$classNames) user_error("DataList::create() Can't find data sub-classes for '$callerClass'");
|
||||||
$classNames = array_map(array(DB::getConn(), 'prepStringForDB'), $classNames);
|
$classNames = array_map(array(DB::getConn(), 'prepStringForDB'), $classNames);
|
||||||
$query->addWhere("\"$baseClass\".\"ClassName\" IN ('" . implode("','", $classNames) . "')");
|
$query->addWhere("\"$baseClass\".\"ClassName\" IN (" . implode(",", $classNames) . ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user