From 42e799bc43eb83660bc4d35c9c6c5bf7f23989a8 Mon Sep 17 00:00:00 2001 From: Florian Thoma Date: Sat, 9 Jun 2018 20:37:52 +0200 Subject: [PATCH] fix Versioned::choose_site_stage() if no request given Load request from curent controller as a fallback --- model/Versioned.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/Versioned.php b/model/Versioned.php index ff0209389..d25b0365e 100644 --- a/model/Versioned.php +++ b/model/Versioned.php @@ -1216,7 +1216,7 @@ class Versioned extends DataExtension implements TemplateGlobalProvider { */ public static function choose_site_stage(SS_HTTPRequest $request = null) { if (!$request) { - throw new InvalidArgumentException("Request not found"); + $request = Controller::curr()->getRequest(); } $mode = static::get_default_reading_mode();