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)

This commit is contained in:
Ingo Schommer 2011-11-21 13:58:08 +01:00
parent 869e90d129
commit a6bb5a3fb7

View File

@ -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']);
}
}
/**