mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
remove Created field on duplicate
This commit is contained in:
parent
2918463619
commit
eecdf56b36
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user