mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT: allow onAfterPublish and onBeforePublish handlers directly on Page classes (#5112)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@103198 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
545b1c2b1a
commit
b6ab3b4ed0
@ -1986,7 +1986,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
if(!$original) $original = new SiteTree();
|
||||
|
||||
// Handle activities undertaken by decorators
|
||||
$this->extend('onBeforePublish', $original);
|
||||
$this->invokeWithExtensions('onBeforePublish', $original);
|
||||
$this->Status = "Published";
|
||||
//$this->PublishedByID = Member::currentUser()->ID;
|
||||
$this->write();
|
||||
@ -2025,7 +2025,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
}
|
||||
|
||||
// Handle activities undertaken by decorators
|
||||
$this->extend('onAfterPublish', $original);
|
||||
$this->invokeWithExtensions('onAfterPublish', $original);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user