mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX ManyMany link table joined with LEFT JOIN
This commit is contained in:
parent
4f3deb13e0
commit
ce3fd370fb
@ -726,7 +726,7 @@ class DataQuery {
|
|||||||
list($parentClass, $componentClass, $parentField, $componentField, $relationTable) = $component;
|
list($parentClass, $componentClass, $parentField, $componentField, $relationTable) = $component;
|
||||||
$parentBaseClass = ClassInfo::baseDataClass($parentClass);
|
$parentBaseClass = ClassInfo::baseDataClass($parentClass);
|
||||||
$componentBaseClass = ClassInfo::baseDataClass($componentClass);
|
$componentBaseClass = ClassInfo::baseDataClass($componentClass);
|
||||||
$this->query->addInnerJoin($relationTable,
|
$this->query->addLeftJoin($relationTable,
|
||||||
"\"$relationTable\".\"$parentField\" = \"$parentBaseClass\".\"ID\"");
|
"\"$relationTable\".\"$parentField\" = \"$parentBaseClass\".\"ID\"");
|
||||||
if (!$this->query->isJoinedTo($componentBaseClass)) {
|
if (!$this->query->isJoinedTo($componentBaseClass)) {
|
||||||
$this->query->addLeftJoin($componentBaseClass,
|
$this->query->addLeftJoin($componentBaseClass,
|
||||||
|
Loading…
Reference in New Issue
Block a user