when building belongsToMany relationships in controllers, the lack of a table name

alias causes an sql ambigious Id error
This commit is contained in:
Kris Arnold 2014-10-16 14:28:36 -05:00
parent 3a7cc9f7aa
commit c75df3a120

View File

@ -414,7 +414,7 @@ class RelationController extends ControllerBehavior
*/
protected function findExistingRelationIds($checkIds = null)
{
$foreignKeyName = $this->relationModel->getKeyName();
$foreignKeyName = $this->relationModel->table . '.' . $this->relationModel->getKeyName();
$results = $this->relationObject
->getBaseQuery()
@ -818,4 +818,4 @@ class RelationController extends ControllerBehavior
return $this->sessionKey = FormHelper::getSessionKey();
}
}
}