mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Fixed issue with StaticPublisher->onAfterWrite() failing because of incorrect arguments to Versioned::get_by_stage()
MINOR Fixed undefined variable error if $urls doesn't exist and tries to loop through the non-existant array in StaticPublisher->onAfterWrite() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@74092 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c9b67367e6
commit
5b993b9990
@ -23,13 +23,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user