FIX: Move stage choosing into a pre-request filter.

This ensures that the correct stage is selected, even if the request
does not come through the model as controller system. This fixes an
issue where custom controllers would always be on the "Stage" stage.
This commit is contained in:
Andrew Short 2013-10-04 00:20:32 +10:00 committed by Stephen Shkardoon
parent 699272a2e7
commit e7c8fed6ab
2 changed files with 25 additions and 0 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() {
}
}