BUGFIX Fixed status checking in SiteTree->getIsDeletedFromStage()/getIsModifiedOnStage()/getIsAddedToStage() for new pages with non-numeric IDs

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69872 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-01-08 01:25:29 +00:00 committed by Sam Minnee
parent 43ab055876
commit bfe69a0715

View File

@ -1710,6 +1710,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* @return boolean
*/
public function getIsModifiedOnStage() {
// new unsaved pages could be never be published
if($this->isNew()) return false;
$stageVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Stage', $this->ID);
$liveVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->ID);
@ -1724,6 +1727,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* @return boolean
*/
public function getIsAddedToStage() {
// new unsaved pages could be never be published
if($this->isNew()) return false;
$stageVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Stage', $this->ID);
$liveVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->ID);