mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
e562ac5477
commit
9c9a461d67
@ -1169,6 +1169,7 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
|
|||||||
// database inconsistencies
|
// database inconsistencies
|
||||||
$componentBaseClass = ClassInfo::baseDataClass($componentClass);
|
$componentBaseClass = ClassInfo::baseDataClass($componentClass);
|
||||||
|
|
||||||
|
|
||||||
$query = $componentObj->extendedSQL(
|
$query = $componentObj->extendedSQL(
|
||||||
"`$table`.$parentField = $this->ID", // filter
|
"`$table`.$parentField = $this->ID", // filter
|
||||||
$sort,
|
$sort,
|
||||||
@ -1177,22 +1178,6 @@ class DataObject extends ViewableData implements DataObjectInterface,i18nEntityP
|
|||||||
);
|
);
|
||||||
array_unshift($query->select, "`$table`.*");
|
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($filter) $query->where[] = $filter;
|
||||||
if($join) $query->from[] = $join;
|
if($join) $query->from[] = $join;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user