From ea8014fadd759d02e565b652bf7d3626dc441887 Mon Sep 17 00:00:00 2001 From: Adam Judd Date: Mon, 12 Oct 2015 13:40:03 +1030 Subject: [PATCH] Force publishPages() to use the Live stage Fixes #42 --- code/extensions/FilesystemPublisher.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/extensions/FilesystemPublisher.php b/code/extensions/FilesystemPublisher.php index 3e18198..0d8504b 100644 --- a/code/extensions/FilesystemPublisher.php +++ b/code/extensions/FilesystemPublisher.php @@ -158,6 +158,10 @@ class FilesystemPublisher extends StaticPublisher { * - "path": The filesystem path where the cache has been written */ public function publishPages($urls) { + // Save current stage and temporarily force it to Live + $oldStage = Versioned::current_stage(); + Versioned::reading_stage("Live"); + $result = array(); //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; }