BUGFIX Fixed issues with StaticPublisher->onAfterWrite() - merged from r74092

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@74093 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-04-06 01:28:03 +00:00
parent 310b75fce6
commit 2680489318

View File

@ -26,13 +26,16 @@ abstract class StaticPublisher extends DataObjectDecorator {
}
function onAfterPublish($original) {
$urls = array();
if($this->owner->hasMethod('pagesAffectedByChanges')) {
$urls = $this->owner->pagesAffectedByChanges($original);
} else {
// $pages = array(Versioned::get_one_by_stage('SiteTree', 'Live', "\"SiteTree\".ID = {$this->owner->ID}"));
$pages = Versioned::get_by_stage('SiteTree', 'Live', '', '', 10);
foreach($pages as $page) {
$urls[] = $page->Link();
$pages = Versioned::get_by_stage('SiteTree', 'Live', '', '', '', 10);
if($pages) {
foreach($pages as $page) {
$urls[] = $page->Link();
}
}
}