Merge pull request #15 from hafriedlander/fix/stageisdefault

FIX Defaulting to stage mode
This commit is contained in:
Mateusz U 2013-07-04 15:26:27 -07:00
commit d9fc615441

View File

@ -72,6 +72,15 @@ class RestfulServer extends Controller {
}
*/
function init() {
/* This sets up SiteTree the same as when viewing a page through the frontend. Versioned defaults
* to Stage, and then when viewing the front-end Versioned::choose_site_stage changes it to Live.
* TODO: In 3.2 we should make the default Live, then change to Stage in the admin area (with a nicer API)
*/
if (class_exists('SiteTree')) singleton('SiteTree')->extend('modelascontrollerInit', $this);
parent::init();
}
/**
* This handler acts as the switchboard for the controller.
* Since no $Action url-param is set, all requests are sent here.