mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Added table references to many-many join used by scaffolder, to remove 'ambiguous column' bugs
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60909 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ffb5d82bc2
commit
2d0233f2b1
@ -1171,9 +1171,9 @@ class DataObject extends ViewableData implements DataObjectInterface {
|
||||
list($parentClass, $componentClass, $parentField, $componentField, $table) = $this->many_many($componentName);
|
||||
|
||||
if($baseTable == $parentClass) {
|
||||
return "LEFT JOIN `$table` ON (`$parentField` = `$parentClass`.`ID` AND `$componentField` = '{$this->ID}')";
|
||||
return "LEFT JOIN `$table` ON (`$table`.`$parentField` = `$parentClass`.`ID` AND `$table`.`$componentField` = '{$this->ID}')";
|
||||
} else {
|
||||
return "LEFT JOIN `$table` ON (`$componentField` = `$componentClass`.`ID` AND `$parentField` = '{$this->ID}')";
|
||||
return "LEFT JOIN `$table` ON (`$table`.`$componentField` = `$componentClass`.`ID` AND `$table`.`$parentField` = '{$this->ID}')";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user