From b75e243276b3e7c202a754618d6956d37b339b1f Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Tue, 17 Sep 2013 14:33:39 +1200 Subject: [PATCH] FIX subsites not activating after recent subsite session changes --- code/search/SearchVariantSubsites.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/code/search/SearchVariantSubsites.php b/code/search/SearchVariantSubsites.php index f2a9b37..dbcc040 100644 --- a/code/search/SearchVariantSubsites.php +++ b/code/search/SearchVariantSubsites.php @@ -31,14 +31,10 @@ class SearchVariantSubsites extends SearchVariant { } function activateState($state) { - if (Controller::has_curr()) { - Subsite::changeSubsite($state); - } - else { - // TODO: This is a nasty hack - calling Subsite::changeSubsite after request ends - // throws error because no current controller to access session on - $_GET['SubsiteID'] = $state; - } + // We always just set the $_GET variable rather than store in Session - this always works, has highest priority + // in Subsite::currentSubsiteID() and doesn't persist unlike Subsite::changeSubsite + $_GET['SubsiteID'] = $state; + Permission::flush_permission_cache(); } function alterDefinition($base, $index) {