mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
#108 - Subsite Virtual Page ordering (from r84848)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89186 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
500ce4a91d
commit
1fed31cb9e
@ -514,7 +514,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
* @return SiteTree The duplicated object.
|
||||
*/
|
||||
public function duplicate($doWrite = true) {
|
||||
$page = parent::duplicate($doWrite);
|
||||
$page = parent::duplicate(false);
|
||||
$page->Sort = 0;
|
||||
if($doWrite) {
|
||||
$page->write();
|
||||
}
|
||||
return $page;
|
||||
}
|
||||
|
||||
@ -552,6 +556,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
public function duplicateAsChild($id) {
|
||||
$newSiteTree = $this->duplicate();
|
||||
$newSiteTree->ParentID = $id;
|
||||
$newSiteTree->Sort = 0;
|
||||
$newSiteTree->write();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user