mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX #6162 CMSMain::publishall() fails when over 30 pages (thanks natmchugh!)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@114940 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8f4b816c1f
commit
22ac12c0c5
@ -1180,8 +1180,7 @@ JS;
|
|||||||
$start = 0;
|
$start = 0;
|
||||||
$pages = DataObject::get("SiteTree", "", "", "", "$start,30");
|
$pages = DataObject::get("SiteTree", "", "", "", "$start,30");
|
||||||
$count = 0;
|
$count = 0;
|
||||||
if($pages){
|
while($pages) {
|
||||||
while(true) {
|
|
||||||
foreach($pages as $page) {
|
foreach($pages as $page) {
|
||||||
if($page && !$page->canPublish()) return Security::permissionFailure($this);
|
if($page && !$page->canPublish()) return Security::permissionFailure($this);
|
||||||
|
|
||||||
@ -1198,7 +1197,6 @@ JS;
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$response .= sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), $count);
|
$response .= sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), $count);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -38,7 +38,7 @@ class CMSMainTest extends FunctionalTest {
|
|||||||
$response = Director::test("admin/cms/publishall", array('confirm' => 1), $this->session());
|
$response = Director::test("admin/cms/publishall", array('confirm' => 1), $this->session());
|
||||||
|
|
||||||
$this->assertContains(
|
$this->assertContains(
|
||||||
sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), 8),
|
sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), 30),
|
||||||
$response->getBody()
|
$response->getBody()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -13,6 +13,50 @@ Page:
|
|||||||
Parent: =>Page.page3
|
Parent: =>Page.page3
|
||||||
page4:
|
page4:
|
||||||
Title: Page 4
|
Title: Page 4
|
||||||
|
page5:
|
||||||
|
Title: Page 5
|
||||||
|
page6:
|
||||||
|
Title: Page 6
|
||||||
|
page7:
|
||||||
|
Title: Page 7
|
||||||
|
page8:
|
||||||
|
Title: Page 8
|
||||||
|
page9:
|
||||||
|
Title: Page 9
|
||||||
|
page10:
|
||||||
|
Title: Page 10
|
||||||
|
page11:
|
||||||
|
Title: Page 11
|
||||||
|
page12:
|
||||||
|
Title: Page 12
|
||||||
|
page13:
|
||||||
|
Title: Page 13
|
||||||
|
page14:
|
||||||
|
Title: Page 14
|
||||||
|
page15:
|
||||||
|
Title: Page 15
|
||||||
|
page16:
|
||||||
|
Title: Page 16
|
||||||
|
page17:
|
||||||
|
Title: Page 17
|
||||||
|
page18:
|
||||||
|
Title: Page 18
|
||||||
|
page19:
|
||||||
|
Title: Page 19
|
||||||
|
page20:
|
||||||
|
Title: Page 20
|
||||||
|
page21:
|
||||||
|
Title: Page 21
|
||||||
|
page22:
|
||||||
|
Title: Page 22
|
||||||
|
page23:
|
||||||
|
Title: Page 23
|
||||||
|
page24:
|
||||||
|
Title: Page 24
|
||||||
|
page25:
|
||||||
|
Title: Page 25
|
||||||
|
page26:
|
||||||
|
Title: Page 26
|
||||||
home:
|
home:
|
||||||
Title: Home
|
Title: Home
|
||||||
URLSegment: home
|
URLSegment: home
|
||||||
|
Loading…
x
Reference in New Issue
Block a user