mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Show '(Choose)' text on TreeDropdownField when a non-existent object is selected, as can happen when related data is removed
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@64355 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
26fde80558
commit
226f7b230e
@ -49,7 +49,7 @@ class TreeDropdownField extends FormField {
|
||||
|
||||
if($this->value) {
|
||||
$record = DataObject::get_by_id($this->sourceObject, $this->value);
|
||||
$title = $record->Title;
|
||||
$title = ($record) ? $record->Title : _t('DropdownField.CHOOSE', "(Choose)", PR_MEDIUM, 'Start-value of a dropdown');;
|
||||
} else {
|
||||
$title = _t('DropdownField.CHOOSE', "(Choose)", PR_MEDIUM, 'Start-value of a dropdown');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user