Browse Source

Merge remote-tracking branch 'origin/2.0' into 2.0-class-loading

Jose Lorenzo Rodriguez 15 years ago
parent
commit
75e5496983

+ 9 - 2
lib/Cake/Controller/Controller.php

@@ -399,7 +399,14 @@ class Controller extends Object {
 
 /**
  * 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
@@ -407,7 +414,7 @@ class Controller extends Object {
 	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']);
 		}

+ 1 - 2
lib/Cake/Routing/Route/RedirectRoute.php

@@ -69,8 +69,7 @@ class RedirectRoute extends CakeRoute {
 			$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;

+ 1 - 0
lib/Cake/TestSuite/ControllerTestCase.php

@@ -174,6 +174,7 @@ class ControllerTestCase extends CakeTestCase {
  * Tests a controller action.
  *
  * ### Options:
+ *
  * - `data` POST or GET data to pass
  * - `method` POST or GET
  *

+ 1 - 1
lib/Cake/tests/cases/libs/controller/scaffold.test.php

@@ -487,7 +487,7 @@ class ScaffoldViewTest extends CakeTestCase {
 	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,