Merge pull request #2585 from ss23/3.1-staging-fix

FIX: Move stage choosing into a pre-request filter.
This commit is contained in:
Ingo Schommer 2013-10-23 01:47:41 -07:00
commit 6694fc5980
3 changed files with 25 additions and 14 deletions

View File

@ -0,0 +1,8 @@
---
Name: requestprocessors
---
Injector:
RequestProcessor:
properties:
filters:
- '%$VersionedRequestFilter'

View File

@ -0,0 +1,17 @@
<?php
/**
* Initialises the versioned stage when a request is made.
*
* @package framework
* @subpackage control
*/
class VersionedRequestFilter {
public function preRequest() {
Versioned::choose_site_stage();
}
public function postRequest() {
}
}

View File

@ -1290,20 +1290,6 @@ class Versioned extends DataExtension {
return $list;
}
/**
* @param Controller $controller
*/
public function contentcontrollerInit($controller) {
self::choose_site_stage();
}
/**
* @param Controller $controller
*/
public function modelascontrollerInit($controller) {
self::choose_site_stage();
}
/**
* @param array $labels
*/