mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fixed SiteTree::IsModifiedOnStage() for an edge-case that was identified when deleteFromStage() stopped manipulating the current record. (from r106082)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112516 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c7b47d8a8b
commit
2aed7be053
@ -2482,7 +2482,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
$stageVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Stage', $this->ID);
|
||||
$liveVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->ID);
|
||||
|
||||
return ($stageVersion != $liveVersion);
|
||||
return ($stageVersion && $stageVersion != $liveVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -801,6 +801,11 @@ class Versioned extends DataObjectDecorator {
|
||||
$clone = clone $this->owner;
|
||||
$result = $clone->delete();
|
||||
Versioned::set_reading_mode($oldMode);
|
||||
|
||||
// Fix the version number cache (in case you go delete from stage and then check ExistsOnLive)
|
||||
$baseClass = ClassInfo::baseDataClass($this->owner->class);
|
||||
self::$cache_versionnumber[$baseClass][$stage][$this->owner->ID] = null;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user