diff --git a/code/CMSMain.php b/code/CMSMain.php index ad9adac5..f6ce4d68 100644 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -1137,14 +1137,23 @@ HTML; ini_set('max_execution_time', 300); if(isset($_POST['confirm'])) { - $pages = DataObject::get("SiteTree"); + $start = 0; + $pages = DataObject::get("SiteTree", "", "", "", "$start,30"); $count = 0; - foreach($pages as $page) { - $this->performPublish($page); - $page->destroy(); - unset($page); - $count++; - echo "
  • $count"; + while(true) { + foreach($pages as $page) { + $this->performPublish($page); + $page->destroy(); + unset($page); + $count++; + echo "
  • $count
  • "; + } + if($pages->Count() > 29) { + $start += 30; + $pages = DataObject::get("SiteTree", "", "", "", "$start,30"); + } else { + break; + } } echo sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), $count);