BUGFIX Publishing test pages regardless of permissions, e.g. when executed in cli

This commit is contained in:
Ingo Schommer 2012-06-15 11:56:24 +02:00
parent 23a41ebf92
commit 2ca8ff1c7d
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ class BigFamilyPage extends Page{
$familyPage = new BigFamilyPage(); $familyPage = new BigFamilyPage();
$familyPage->Title = "Big Family"; $familyPage->Title = "Big Family";
$familyPage->write(); $familyPage->write();
$familyPage->doPublish(); $familyPage->publish('Stage', 'Live');
foreach(singleton('Employee')->data() as $name){ foreach(singleton('Employee')->data() as $name){
$page = new Page(); $page = new Page();
@ -39,7 +39,7 @@ class BigFamilyPage extends Page{
$page->MenuTitle = $name; $page->MenuTitle = $name;
$page->ParentID = $familyPage->ID; $page->ParentID = $familyPage->ID;
$page->write(); $page->write();
$page->doPublish(); $page->publish('Stage', 'Live');
} }
DB::alteration_message("Added default 'BigFamilyPage' and its children pages","created"); DB::alteration_message("Added default 'BigFamilyPage' and its children pages","created");

View File

@ -20,7 +20,7 @@ class FTPageMakerTask extends BuildTask {
$page->ParentID = $parentID; $page->ParentID = $parentID;
$page->Title = "Test page $prefix$i"; $page->Title = "Test page $prefix$i";
$page->write(); $page->write();
$page->doPublish(); $page->publish('Stage', 'Live');
echo "<li>Created '$page->Title'"; echo "<li>Created '$page->Title'";
if($depth > 1) $this->makePages($count, $depth-1, $prefix."$i.", $page->ID); if($depth > 1) $this->makePages($count, $depth-1, $prefix."$i.", $page->ID);