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:
Ingo Schommer 2010-04-13 03:26:47 +00:00
parent ae5cf37f2d
commit 81f5920228

View File

@ -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);
}
/**