FIX Don't pass labelfield as value for SEarchableDropdownField (#11303)

This commit is contained in:
Guy Sartorelli 2024-07-09 10:09:27 +12:00 committed by GitHub
parent dbc0288038
commit 0bb88d0988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2507,7 +2507,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
$list = DataList::create(static::class); $list = DataList::create(static::class);
$threshold = DBForeignKey::config()->get('dropdown_field_threshold'); $threshold = DBForeignKey::config()->get('dropdown_field_threshold');
$overThreshold = $list->count() > $threshold; $overThreshold = $list->count() > $threshold;
$field = SearchableDropdownField::create($fieldName, $fieldTitle, $list, $labelField) $field = SearchableDropdownField::create($fieldName, $fieldTitle, $list, $ownerRecord->{$relationName . 'ID'}, $labelField)
->setIsLazyLoaded($overThreshold) ->setIsLazyLoaded($overThreshold)
->setLazyLoadLimit($threshold); ->setLazyLoadLimit($threshold);
return $field; return $field;