This commit is contained in:
Samuel Georges 2015-01-21 17:01:07 +11:00
parent d850a795fd
commit 46dd064aad
1 changed files with 2 additions and 1 deletions

View File

@ -113,9 +113,10 @@ class Relation extends FormWidgetBase
}
elseif (in_array($this->relationType, ['belongsTo', 'hasOne'])) {
$field->type = 'dropdown';
$field->placeholder = $this->emptyOption;
}
$field->placeholder = $this->emptyOption;
// It is safe to assume that if the model and related model are of
// the exact same class, then it cannot be related to itself
if ($model->exists && (get_class($model) == get_class($relatedObj))) {