mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
BUGFIX: A page type with requireDefaultRecords(), for instance ErrorPage, was created everytime on the main site when dev/build-ing (with subdomain in the url) and there's no that page type in the subsite's sitetree.
This commit is contained in:
parent
221599c776
commit
0b3b4b555c
@ -86,7 +86,10 @@ class SiteTreeSubsites extends DataObjectDecorator {
|
||||
protected $nextWriteDoesntCustomise = false;
|
||||
|
||||
function augmentBeforeWrite() {
|
||||
if(!is_numeric($this->owner->ID) && !$this->owner->SubsiteID) $this->owner->SubsiteID = Subsite::currentSubsiteID();
|
||||
// if the page hasn't been written to a database table yet and no subsite has been set, then give it a subsite
|
||||
if((!is_numeric($this->owner->ID) || $this->owner->ID == 0) && !$this->owner->SubsiteID) {
|
||||
$this->owner->SubsiteID = Subsite::currentSubsiteID();
|
||||
}
|
||||
|
||||
// If the content has been changed, then the page should be marked as 'custom content'
|
||||
if(!$this->nextWriteDoesntCustomise && $this->owner->ID && $this->owner->MasterPageID && !$this->owner->CustomContent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user