mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-06 01:31:22 +02:00
fix Versioned::choose_site_stage() if no request given
Load request from curent controller as a fallback
This commit is contained in:
parent
d9261af1f3
commit
42e799bc43
@ -1216,7 +1216,7 @@ class Versioned extends DataExtension implements TemplateGlobalProvider {
|
|||||||
*/
|
*/
|
||||||
public static function choose_site_stage(SS_HTTPRequest $request = null) {
|
public static function choose_site_stage(SS_HTTPRequest $request = null) {
|
||||||
if (!$request) {
|
if (!$request) {
|
||||||
throw new InvalidArgumentException("Request not found");
|
$request = Controller::curr()->getRequest();
|
||||||
}
|
}
|
||||||
$mode = static::get_default_reading_mode();
|
$mode = static::get_default_reading_mode();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user