Fix TreeDowndropField copying

This commit is contained in:
Christopher Joe 2017-05-17 16:51:30 +12:00
parent 4c1a4eb474
commit 0534a5ec0c

View File

@ -636,6 +636,21 @@ class TreeDropdownField extends FormField
$copy->setSourceObject($this->sourceObject);
return $copy;
}
/**
* @param string|FormField $classOrCopy
* @return FormField
*/
public function castedCopy($classOrCopy)
{
$field = $classOrCopy;
if (!is_object($field)) {
$field = new $classOrCopy($this->name, $this->title, $this->sourceObject);
}
return parent::castedCopy($field);
}
public function getSchemaStateDefaults()
{