From b6ab3b4ed0abba9d6568bb46968112d544b15517 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Tue, 20 Apr 2010 22:15:16 +0000 Subject: [PATCH] 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 --- core/model/SiteTree.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index 2fc48a8a5..cbf608b4d 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -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; }