From 0bb88d0988bffdc9dbd0f083e1e32f440f85030f Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Tue, 9 Jul 2024 10:09:27 +1200 Subject: [PATCH] FIX Don't pass labelfield as value for SEarchableDropdownField (#11303) --- src/ORM/DataObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ORM/DataObject.php b/src/ORM/DataObject.php index a576d96b685..86ddce77032 100644 --- a/src/ORM/DataObject.php +++ b/src/ORM/DataObject.php @@ -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;