mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
Merge branch '3.6' into 3
This commit is contained in:
commit
c3a6595bb8
@ -12,7 +12,7 @@ addons:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- CORE_RELEASE=3
|
- CORE_RELEASE=3.5
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -2541,21 +2541,27 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the page from both live and stage
|
* Removes the page from both live and stage, if it exists on both
|
||||||
|
* otherwise just removes from stage
|
||||||
*
|
*
|
||||||
* @return bool Success
|
* @return bool Success
|
||||||
*/
|
*/
|
||||||
public function doArchive() {
|
public function doArchive() {
|
||||||
$this->invokeWithExtensions('onBeforeArchive', $this);
|
$this->invokeWithExtensions('onBeforeArchive', $this);
|
||||||
|
$doDelete = false;
|
||||||
|
|
||||||
if($this->doUnpublish()) {
|
if($this->ExistsOnLive) {
|
||||||
$this->delete();
|
$doDelete = $this->doUnpublish();
|
||||||
$this->invokeWithExtensions('onAfterArchive', $this);
|
} else {
|
||||||
|
$doDelete = true;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
if ($doDelete) {
|
||||||
|
$this->delete();
|
||||||
|
$this->invokeWithExtensions('onAfterArchive', $this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $doDelete;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user