diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 48ff55c70..b3114d0b4 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -752,12 +752,15 @@ protected function init() // Assign default cms theme and replace user-specified themes SSViewer::set_themes(LeftAndMain::config()->uninherited('admin_themes')); - - // Set the current reading mode - Versioned::set_stage(Versioned::DRAFT); - - // Set default reading mode to suppress ?stage=Stage querystring params in CMS - Versioned::set_default_reading_mode(Versioned::get_reading_mode()); + + // Check the presence of Silverstripe-Versioned module + if (class_exists(Versioned::class)) { + // Set the current reading mode + Versioned::set_stage(Versioned::DRAFT); + + // Set default reading mode to suppress ?stage=Stage querystring params in CMS + Versioned::set_default_reading_mode(Versioned::get_reading_mode()); + } } public function handleRequest(HTTPRequest $request)