BUGFIX Qualify join table in ON clause in ManyManyList to avoid ambiguous column names

This commit is contained in:
Ingo Schommer 2012-03-14 17:03:29 +01:00
parent 687a1ca72b
commit 2555ccb543

View File

@ -59,7 +59,7 @@ class ManyManyList extends RelationList {
$baseClass = ClassInfo::baseDataClass($dataClass); $baseClass = ClassInfo::baseDataClass($dataClass);
// Join to the many-many join table // Join to the many-many join table
$this->dataQuery->innerJoin($joinTable, "\"$this->localKey\" = \"$baseClass\".\"ID\""); $this->dataQuery->innerJoin($joinTable, "\"$joinTable\".\"$this->localKey\" = \"$baseClass\".\"ID\"");
// Query the extra fields from the join table // Query the extra fields from the join table
if($extraFields) $this->dataQuery->selectFromTable($joinTable, array_keys($extraFields)); if($extraFields) $this->dataQuery->selectFromTable($joinTable, array_keys($extraFields));