mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
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:
parent
869e90d129
commit
a6bb5a3fb7
@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user