mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
fixed virtual page creation. yay!
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42849 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6eb306f343
commit
023778c002
@ -88,8 +88,10 @@ class VirtualPage extends Page {
|
||||
function onBeforeWrite() {
|
||||
// Don't do this stuff when we're publishing
|
||||
if(!$this->extension_instances['Versioned']->migratingVersion) {
|
||||
if(($this->changed['CopyContentFromID'] || !$this->Content) && $this->class == 'VirtualPage' ) {
|
||||
$source = $this->CopyContentFrom();
|
||||
if(isset($this->changed['CopyContentFromID']) && $this->changed['CopyContentFromID']
|
||||
&& $this->CopyContentFromID != 0 && $this->class == 'VirtualPage' ) {
|
||||
$CopyContentFromID = $this->CopyContentFromID;
|
||||
$source = DataObject::get_one("Sitetree","`Sitetree`.`ID`='$CopyContentFromID'");
|
||||
$this->copyFrom($source);
|
||||
$this->URLSegment = $source->URLSegment . '-' . $this->ID;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user