mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
BUGFIX Publishing test pages regardless of permissions, e.g. when executed in cli
This commit is contained in:
parent
23a41ebf92
commit
2ca8ff1c7d
@ -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");
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user