API CHANGE Removed unused nextWriteDoesntCustomise flag on SiteTreeSubsites, removed references to non-existent CustomContent field in SiteTreeSubsites->onBeforeWrite() (field was removed with 08207510c in 2008) (AIR-52)

This commit is contained in:
Ingo Schommer 2011-09-07 21:55:02 +02:00
parent bb486548d6
commit 47c545f658
2 changed files with 0 additions and 27 deletions

View File

@ -81,33 +81,8 @@ class SiteTreeSubsites extends SiteTreeDecorator {
}
}
/**
* Call this method before writing; the next write carried out by the system won't
* set the CustomContent value
*/
function nextWriteDoesntCustomise() {
$this->nextWriteDoesntCustomise = true;
}
protected $nextWriteDoesntCustomise = false;
function onBeforeWrite() {
if(!$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->nextWriteDoesntCustomise && $this->owner->ID && $this->owner->MasterPageID && !$this->owner->CustomContent) {
$changed = $this->owner->getChangedFields();
foreach(self::$template_fields as $field) {
if(isset($changed[$field]) && $changed[$field]) {
$this->owner->CustomContent = true;
FormResponse::add("if($('Form_EditForm_CustomContent')) $('Form_EditForm_CustomContent').checked = true;");
break;
}
}
}
$this->nextWriteDoesntCustomise = false;
parent::onBeforeWrite();
}

View File

@ -148,9 +148,7 @@ class SubsitesVirtualPage extends VirtualPage {
class SubsitesVirtualPage_Controller extends VirtualPage_Controller {
function reloadContent() {
$this->failover->nextWriteDoesntCustomise();
$this->failover->copyFrom($this->failover->CopyContentFrom());
$this->failover->nextWriteDoesntCustomise();
$this->failover->write();
return;
}