mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
43ab055876
commit
bfe69a0715
@ -1710,6 +1710,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function getIsModifiedOnStage() {
|
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);
|
$stageVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Stage', $this->ID);
|
||||||
$liveVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $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
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function getIsAddedToStage() {
|
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);
|
$stageVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Stage', $this->ID);
|
||||||
$liveVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->ID);
|
$liveVersion = Versioned::get_versionnumber_by_stage('SiteTree', 'Live', $this->ID);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user