From 77f4dc1eee26f55fbe6255fd7d862531def6553a Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Mon, 8 Jul 2024 15:45:32 +1200 Subject: [PATCH] FIX Don't pass labelfield as value for SEarchableDropdownField --- 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;