From 06623537c48c9d317aa647bf4021c4d846375fb9 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Thu, 30 Jun 2016 18:00:41 +1200 Subject: [PATCH] BUG Don't hard-code folder into treedropdownfield search hint Fixes https://github.com/silverstripe/silverstripe-cms/issues/1518 --- forms/TreeDropdownField.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/forms/TreeDropdownField.php b/forms/TreeDropdownField.php index 5b4e04ea2..1315f3016 100644 --- a/forms/TreeDropdownField.php +++ b/forms/TreeDropdownField.php @@ -217,11 +217,12 @@ class TreeDropdownField extends FormField { Requirements::css(FRAMEWORK_DIR . '/thirdparty/jquery-ui-themes/smoothness/jquery-ui.css'); Requirements::css(FRAMEWORK_DIR . '/client/dist/styles/TreeDropdownField.css'); - if($this->showSearch) { - $emptyTitle = _t('DropdownField.CHOOSESEARCH', '(choose folder)', 'start value of a dropdown'); - } else { - $emptyTitle = _t('DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown'); - } + $item = DataObject::singleton($this->sourceObject); + $emptyTitle = _t( + 'DropdownField.CHOOSE_MODEL', + '(Choose {name})', + ['name' => $item->i18n_singular_name()] + ); $record = $this->Value() ? $this->objectForKey($this->Value()) : null; if($record instanceof ViewableData) {