remove Created field on duplicate

This commit is contained in:
Andrew Aitken-Fincham 2016-12-19 13:50:48 +00:00
parent 2918463619
commit eecdf56b36

View File

@ -531,7 +531,9 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
*/
public function duplicate($doWrite = true) {
$className = $this->class;
$clone = new $className( $this->toMap(), false, $this->model );
$map = $this->toMap();
unset($map['Created']);
$clone = new $className( $map, false, $this->model );
$clone->ID = 0;
$clone->invokeWithExtensions('onBeforeDuplicate', $this, $doWrite);