mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
BUGFIX: Updated onAfterUnpublish to republish page from static cache as well as unpublish them. (from r90002) (from r96799)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102662 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ae5cf37f2d
commit
81f5920228
@ -84,6 +84,7 @@ abstract class StaticPublisher extends DataObjectDecorator {
|
||||
function onAfterUnpublish($page) {
|
||||
if (self::$disable_realtime) return;
|
||||
|
||||
// Get the affected URLs
|
||||
if($this->owner->hasMethod('pagesAffectedByUnpublishing')) {
|
||||
$urls = $this->owner->pagesAffectedByUnpublishing();
|
||||
$urls = array_unique($urls);
|
||||
@ -91,7 +92,16 @@ abstract class StaticPublisher extends DataObjectDecorator {
|
||||
$urls = array($this->owner->AbsoluteLink());
|
||||
}
|
||||
|
||||
$this->unpublishPages($urls);
|
||||
$legalPages = $this->owner->allPagesToCache();
|
||||
|
||||
$urlsToRepublish = array_intersect($urls, $legalPages);
|
||||
$urlsToUnpublish = array_diff($urls, $legalPages);
|
||||
|
||||
Debug::dump($urlsToRepublish);
|
||||
Debug::dump($urlsToUnpublish);
|
||||
|
||||
$this->unpublishPages($urlsToUnpublish);
|
||||
$this->publishPages($urlsToRepublish);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user