From 62ec1d1a6f1ca559f03ea5d703b86be7f35bb1b0 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Thu, 21 Aug 2008 05:08:38 +0000 Subject: [PATCH] --- code/SiteTreeSubsites.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/SiteTreeSubsites.php b/code/SiteTreeSubsites.php index 77f23bd..9f8510e 100644 --- a/code/SiteTreeSubsites.php +++ b/code/SiteTreeSubsites.php @@ -65,9 +65,11 @@ class SiteTreeSubsites extends DataObjectDecorator { if(!is_numeric($this->owner->ID) && !$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->owner->CustomContent) { + if($this->owner->ID && $this->owner->MasterPageID && !$this->owner->CustomContent) { + $changed = $this->owner->getChangedFields(); + foreach(self::$template_fields as $field) { - if($this->owner->original[$field] != $this->owner->record[$field]) { + if(isset($changed[$field]) && $changed[$field]) { $this->owner->CustomContent = true; FormResponse::add("$('Form_EditForm_CustomContent').checked = true;"); break;