diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 9052dc6cc..8c5f22b04 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -675,7 +675,7 @@ class RelationController extends ControllerBehavior */ $existingIds = $this->findExistingRelationIds(); if (count($existingIds)) { - $query->whereNotIn('id', $existingIds); + $query->whereNotIn($this->relationModel->getQualifiedKeyName(), $existingIds); } });