mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX only use sethasemptydefault if exists.
Backport of #4672 with a slight rewrite incase of subclasses of the field.
This commit is contained in:
parent
f5f2861dc5
commit
c3641587a5
@ -362,7 +362,9 @@ class DropdownField extends FormField {
|
||||
*/
|
||||
public function castedCopy($classOrCopy) {
|
||||
$field = parent::castedCopy($classOrCopy);
|
||||
$field->setHasEmptyDefault($this->getHasEmptyDefault());
|
||||
if($field->hasMethod('setHasEmptyDefault')) {
|
||||
$field->setHasEmptyDefault($this->getHasEmptyDefault());
|
||||
}
|
||||
return $field;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user