mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: fixed onBeforeDuplicate calling before page existed (from r96879)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102411 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
7b3e45539b
commit
2f849222f8
@ -497,13 +497,15 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
*/
|
||||
public function duplicate($doWrite = true) {
|
||||
|
||||
$this->extend('onBeforeDuplicate', $page);
|
||||
$page = parent::duplicate(false);
|
||||
$page->Sort = 0;
|
||||
$this->extend('onBeforeDuplicate', $page);
|
||||
|
||||
if($doWrite) {
|
||||
$page->write();
|
||||
}
|
||||
$this->extend('onAfterDuplicate', $page);
|
||||
|
||||
return $page;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user