From d78a7583dae097df1af3b3675f9c4e903f1d78ec Mon Sep 17 00:00:00 2001 From: Nathan Glasl Date: Tue, 28 Mar 2017 10:03:20 +1100 Subject: [PATCH] FIX, a site object fallback will now actually be used. --- code/services/MisdirectionService.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/services/MisdirectionService.php b/code/services/MisdirectionService.php index 955ac67..3e977b5 100644 --- a/code/services/MisdirectionService.php +++ b/code/services/MisdirectionService.php @@ -262,9 +262,12 @@ public function determineFallback($URL) { if(ClassInfo::exists('Multisites')) { $parent = Multisites::inst()->getCurrentSite(); $parentID = $parent->ID; - $applicableRule = $parent->Fallback; - $toURL = $parent->FallbackLink; - $responseCode = $parent->FallbackResponseCode; + if($parent->Fallback) { + $applicableRule = $parent->Fallback; + $nearestParent = $thisPage = Director::baseURL(); + $toURL = $parent->FallbackLink; + $responseCode = $parent->FallbackResponseCode; + } } else { $parentID = 0;