From a6bb5a3fb78ad08724f989e8d36a041503be6d7d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 21 Nov 2011 13:58:08 +0100 Subject: [PATCH] BUGFIX Update SubsiteID in session and clear currently viewed record when changing subsite via a GET parameter, which is more common now through 069c5ada3 (fixes AIR-130) --- code/LeftAndMainSubsites.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/LeftAndMainSubsites.php b/code/LeftAndMainSubsites.php index 733c8da..73c0bda 100644 --- a/code/LeftAndMainSubsites.php +++ b/code/LeftAndMainSubsites.php @@ -10,6 +10,16 @@ class LeftAndMainSubsites extends Extension { Requirements::css('subsites/css/LeftAndMain_Subsites.css'); Requirements::javascript('subsites/javascript/LeftAndMain_Subsites.js'); Requirements::javascript('subsites/javascript/VirtualPage_Subsites.js'); + + if(isset($_REQUEST['SubsiteID'])) { + // Clear current page when subsite changes (or is set for the first time) + if(!Session::get('SubsiteID') || $_REQUEST['SubsiteID'] != Session::get('SubsiteID')) { + Session::clear("{$this->owner->class}.currentPage"); + } + + // Update current subsite in session + Subsite::changeSubsite($_REQUEST['SubsiteID']); + } } /**