Merge branch '3.6' into 3

This commit is contained in:
Daniel Hensby 2017-05-26 14:56:15 +01:00
commit c3a6595bb8
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
2 changed files with 14 additions and 8 deletions

View File

@ -12,7 +12,7 @@ addons:
env:
global:
- CORE_RELEASE=3
- CORE_RELEASE=3.5
matrix:
include:

View File

@ -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
*/
public function doArchive() {
$this->invokeWithExtensions('onBeforeArchive', $this);
$doDelete = false;
if($this->doUnpublish()) {
$this->delete();
$this->invokeWithExtensions('onAfterArchive', $this);
return true;
if($this->ExistsOnLive) {
$doDelete = $this->doUnpublish();
} else {
$doDelete = true;
}
return false;
if ($doDelete) {
$this->delete();
$this->invokeWithExtensions('onAfterArchive', $this);
}
return $doDelete;
}
/**