Use the otherKey to update a relation

If the `otherKey` of the relationship was set, the widget was considering the wrong column name.
This commit is contained in:
oliverpool 2016-11-24 13:33:20 +01:00 committed by GitHub
parent 35296c5b26
commit 01193511d5
1 changed files with 2 additions and 2 deletions

View File

@ -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;
});