diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 8040297ec87..f09601c865b 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -403,7 +403,14 @@ public function __set($name, $value) { /** * Sets the request objects and configures a number of controller properties - * based on the contents of the request. + * based on the contents of the request. The properties that get set are + * + * - $this->request - To the $request parameter + * - $this->plugin - To the $request->params['plugin'] + * - $this->view - To the $request->params['action'] + * - $this->autoLayout - To the false if $request->params['bare']; is set. + * - $this->autoRender - To false if $request->params['return'] == 1 + * - $this->passedArgs - The the combined results of params['named'] and params['pass] * * @param CakeRequest $request * @return void @@ -411,7 +418,7 @@ public function __set($name, $value) { public function setRequest(CakeRequest $request) { $this->request = $request; $this->plugin = isset($request->params['plugin']) ? $request->params['plugin'] : null; - + $this->view = isset($request->params['action']) ? $request->params['action'] : null; if (isset($request->params['pass']) && isset($request->params['named'])) { $this->passedArgs = array_merge($request->params['pass'], $request->params['named']); } diff --git a/cake/libs/route/redirect_route.php b/cake/libs/route/redirect_route.php index 8b9a63fe2a2..9746b78142e 100644 --- a/cake/libs/route/redirect_route.php +++ b/cake/libs/route/redirect_route.php @@ -68,8 +68,7 @@ public function parse($url) { $redirect = $this->redirect[0]; } if (isset($this->options['persist']) && is_array($redirect)) { - $argOptions['context'] = array('action' => $redirect['action'], 'controller' => $redirect['controller']); - $redirect += Router::getArgs($params['_args_'], $argOptions) + array('url' => array()); + $redirect += array('named' => $params['named'], 'pass' => $params['pass'], 'url' => array()); $redirect = Router::reverse($redirect); } $status = 301; diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 54a67beff4a..7c1e4d51cf7 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -485,7 +485,7 @@ function testViewScaffold() { function testEditScaffold() { $this->Controller->request->base = ''; $this->Controller->request->webroot = '/'; - $this->Controller->request->here = '/scaffold_mock'; + $this->Controller->request->here = '/scaffold_mock/edit/1'; $params = array( 'plugin' => null, diff --git a/cake/tests/lib/controller_test_case.php b/cake/tests/lib/controller_test_case.php index 150bf12a5cf..76d34f310d2 100644 --- a/cake/tests/lib/controller_test_case.php +++ b/cake/tests/lib/controller_test_case.php @@ -171,6 +171,7 @@ public function __call($name, $arguments) { * Tests a controller action. * * ### Options: + * * - `data` POST or GET data to pass * - `method` POST or GET *