BUGFIX Removed project-specific hack in DataObject->getManyManyComponentsQuery() as it was breaking Translatable saving

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65518 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-11-10 02:36:21 +00:00
parent e562ac5477
commit 9c9a461d67

View File

@ -1169,6 +1169,7 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
// database inconsistencies
$componentBaseClass = ClassInfo::baseDataClass($componentClass);
$query = $componentObj->extendedSQL(
"`$table`.$parentField = $this->ID", // filter
$sort,
@ -1177,22 +1178,6 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
);
array_unshift($query->select, "`$table`.*");
// FIXME: We were having database crashing troubles with GIS content being accessed from with the link
// tracking join. In order to fix it, we're altering the query just for this many-many relation.
// The more long-term fix to this is to let developers specify which data columns they are actually interested
// in, and thereby optimise the query in a more loosely coupled fashion.
if($table == "SiteTree_LinkTracking") {
$filteredSelect = array();
foreach($query->select as $item) {
if(strpos($item,'SiteTree') !== false) $filteredSelect[] = $item;
}
$query->select = $filteredSelect;
$query->from = array(
"SiteTree" => $query->from["SiteTree"],
$query->from[0],
);
}
if($filter) $query->where[] = $filter;
if($join) $query->from[] = $join;