Hello,
Im trying to publish all my page by accessing the url: www.url.com/admin/publishall
When i hit the publish all button i get the following error:
[Warning] Invalid argument supplied for foreach()
POST /sapphire/main.php?url=/admin/publishall&
Line 1247 in C:\Inetpub\vhosts\....\httpdocs\cms\code\CMSMain.php
Source
1238
1239 $response = "";
1240
1241 if(isset($this->requestParams['confirm'])) {
1242 $start = 0;
1243 $pages = DataObject::get("SiteTree", "", "", "", "$start,30");
1244 $count = 0;
1245 if($pages){
1246 while(true) {
1247 foreach($pages as $page) {
1248 if($page && !$page->canPublish()) return Security::permissionFailure($this);
1249
1250 $page->doPublish();
1251 $page->destroy();
1252 unset($page);
1253 $count++;
Trace
* CMSMain->publishall(SS_HTTPRequest)
Line 193 of Controller.php
* Controller->handleAction(SS_HTTPRequest)
Line 137 of RequestHandler.php
* RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
* Controller->handleRequest(SS_HTTPRequest)
Line 281 of Director.php
* Director::handleRequest(SS_HTTPRequest,Session)
Line 124 of Director.php
* Director::direct(/admin/publishall)
Line 127 of main.php
Why?
and what to do?