mirror of
https://github.com/silverstripe/silverstripe-staticpublisher
synced 2024-10-22 14:05:54 +02:00
Merge pull request #49 from adamjudd/patch-1
Force publishPages() to use the Live stage
This commit is contained in:
commit
680bd6b36f
@ -158,6 +158,10 @@ class FilesystemPublisher extends StaticPublisher {
|
|||||||
* - "path": The filesystem path where the cache has been written
|
* - "path": The filesystem path where the cache has been written
|
||||||
*/
|
*/
|
||||||
public function publishPages($urls) {
|
public function publishPages($urls) {
|
||||||
|
// Save current stage and temporarily force it to Live
|
||||||
|
$oldStage = Versioned::current_stage();
|
||||||
|
Versioned::reading_stage("Live");
|
||||||
|
|
||||||
$result = array();
|
$result = array();
|
||||||
|
|
||||||
//nest the config so we can make changes to the config and revert easily
|
//nest the config so we can make changes to the config and revert easily
|
||||||
@ -326,6 +330,9 @@ class FilesystemPublisher extends StaticPublisher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Revert the stage back to what it was
|
||||||
|
Versioned::reading_stage($oldStage);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user