Skip to content

Commit

Permalink
FIX Don't pass labelfield as value for SEarchableDropdownField (#11303)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jul 8, 2024
1 parent dbc0288 commit 0bb88d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ORM/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -2507,7 +2507,7 @@ public function scaffoldFormFieldForHasOne(
$list = DataList::create(static::class);
$threshold = DBForeignKey::config()->get('dropdown_field_threshold');
$overThreshold = $list->count() > $threshold;
$field = SearchableDropdownField::create($fieldName, $fieldTitle, $list, $labelField)
$field = SearchableDropdownField::create($fieldName, $fieldTitle, $list, $ownerRecord->{$relationName . 'ID'}, $labelField)
->setIsLazyLoaded($overThreshold)
->setLazyLoadLimit($threshold);
return $field;
Expand Down

0 comments on commit 0bb88d0

Please sign in to comment.