From 01193511d5ec1509b3d55d2a6d077a6ba5b93824 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Thu, 24 Nov 2016 13:33:20 +0100 Subject: [PATCH] Use the otherKey to update a relation If the `otherKey` of the relationship was set, the widget was considering the wrong column name. --- modules/backend/formwidgets/Relation.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/backend/formwidgets/Relation.php b/modules/backend/formwidgets/Relation.php index 17aef5e08..3dc4e4f9e 100644 --- a/modules/backend/formwidgets/Relation.php +++ b/modules/backend/formwidgets/Relation.php @@ -140,8 +140,8 @@ class Relation extends FormWidgetBase } $field->options = $usesTree - ? $result->listsNested($nameFrom, $relationModel->getKeyName()) - : $result->lists($nameFrom, $relationModel->getKeyName()); + ? $result->listsNested($nameFrom, $relationObject->getOtherKey()) + : $result->lists($nameFrom, $relationObject->getOtherKey()); return $field; });