From c75df3a120806af0b86b089a6f410a15368ec314 Mon Sep 17 00:00:00 2001 From: Kris Arnold Date: Thu, 16 Oct 2014 14:28:36 -0500 Subject: [PATCH] when building belongsToMany relationships in controllers, the lack of a table name alias causes an sql ambigious Id error --- modules/backend/behaviors/RelationController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index a53fff7a5..8d14251e6 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -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(); } -} \ No newline at end of file +}