Permalink
Browse files

BUGFIX Qualify join table in ON clause in ManyManyList to avoid ambig…

…uous column names
  • Loading branch information...
1 parent 687a1ca commit 2555ccb543b8f819ff6ccbfa8ff00018f69225ce @chillu chillu committed Mar 14, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 model/ManyManyList.php
View
@@ -59,7 +59,7 @@ function __construct($dataClass, $joinTable, $localKey, $foreignKey, $extraField
$baseClass = ClassInfo::baseDataClass($dataClass);
// 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
if($extraFields) $this->dataQuery->selectFromTable($joinTable, array_keys($extraFields));

0 comments on commit 2555ccb

Please sign in to comment.