mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ManyMany Self Relation Problem Fixing (merged from branches/2.2.0@45907, r45025)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@46091 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
25aaf25c23
commit
bde465d77c
@ -21,9 +21,12 @@ class ManyManyComplexTableField extends HasManyComplexTableField {
|
||||
}
|
||||
}
|
||||
$source = $this->sourceClass;
|
||||
$sourceField = $this->sourceClass;
|
||||
if( $this->manyManyParentClass == $source )
|
||||
$sourceField = 'Child';
|
||||
$parentID = $this->controller->ID;
|
||||
|
||||
$this->sourceJoin .= " LEFT JOIN `$manyManyTable` ON ( `$source`.`ID` = `{$source}ID` AND `{$this->manyManyParentClass}ID` = '$parentID' )";
|
||||
$this->sourceJoin .= " LEFT JOIN `$manyManyTable` ON ( `$source`.`ID` = `{$sourceField}ID` AND `{$this->manyManyParentClass}ID` = '$parentID' )";
|
||||
|
||||
$this->joinField = 'Checked';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user