Fixing error where params[url] has moved.

This commit is contained in:
mark_story 2010-11-09 23:40:15 -05:00
parent ee0dc785b2
commit 6c0dfe9592
3 changed files with 12 additions and 12 deletions

View file

@ -121,8 +121,8 @@ class RequestHandlerComponent extends Component {
public function initialize(&$controller, $settings = array()) {
$this->request = $controller->request;
$this->response = $controller->response;
if (isset($controller->params['url']['ext'])) {
$this->ext = $controller->params['url']['ext'];
if (isset($this->request->params['url']['ext'])) {
$this->ext = $this->request->params['url']['ext'];
}
if (empty($this->ext)) {
$accepts = $this->request->accepts();

View file

@ -1039,7 +1039,7 @@ class Controller extends Object {
), E_USER_WARNING);
return array();
}
$options = array_merge($this->request->params, $this->request->params['url'], $this->passedArgs);
$options = array_merge($this->request->params, $this->request->query, $this->passedArgs);
if (isset($this->paginate[$object->alias])) {
$defaults = $this->paginate[$object->alias];

View file

@ -610,7 +610,7 @@ class ControllerTest extends CakeTestCase {
$Controller = new Controller($request);
$Controller->uses = array('ControllerPost', 'ControllerComment');
$Controller->passedArgs[] = '1';
$Controller->params['url'] = array();
$Controller->query = array();
$Controller->constructClasses();
$results = Set::extract($Controller->paginate('ControllerPost'), '{n}.ControllerPost.id');
@ -700,7 +700,7 @@ class ControllerTest extends CakeTestCase {
$Controller->uses = array('ControllerPost', 'ControllerComment');
$Controller->passedArgs[] = '1';
$Controller->params['url'] = array();
$Controller->query = array();
$Controller->constructClasses();
$Controller->passedArgs = array('page' => '-1', 'contain' => array('ControllerComment'));
@ -731,7 +731,7 @@ class ControllerTest extends CakeTestCase {
$Controller = new Controller($request);
$Controller->uses = array('ControllerPaginateModel');
$Controller->params['url'] = array();
$Controller->query = array();
$Controller->constructClasses();
$Controller->paginate = array(
'ControllerPaginateModel' => array('contain' => array('ControllerPaginateModel'), 'group' => 'Comment.author_id')
@ -760,7 +760,7 @@ class ControllerTest extends CakeTestCase {
$Controller =& new Controller();
$Controller->uses = array('ControllerPost');
$Controller->request = $this->getMock('CakeRequest');
$Controller->request->params['url'] = array();
$Controller->request->query = array();
$Controller->constructClasses();
$Controller->paginate = array(
@ -801,7 +801,7 @@ class ControllerTest extends CakeTestCase {
$Controller = new Controller($request);
$Controller->uses = array('ControllerPost');
$Controller->passedArgs[] = array('1', '2', '3');
$Controller->params['url'] = array();
$Controller->query = array();
$Controller->constructClasses();
$Controller->paginate = array(
@ -837,7 +837,7 @@ class ControllerTest extends CakeTestCase {
$Controller = new Controller($request);
$Controller->uses = array('ControllerPost', 'ControllerComment');
$Controller->passedArgs[] = '1';
$Controller->params['url'] = array();
$Controller->query = array();
$Controller->constructClasses();
$Controller->paginate = array('ControllerPost' => array('popular', 'fields' => array('id', 'title')));
@ -861,7 +861,7 @@ class ControllerTest extends CakeTestCase {
$Controller = new Controller($request);
$Controller->modelClass = 'ControllerPost';
$Controller->params['url'] = array();
$Controller->query = array();
$Controller->paginate = array('order' => 'ControllerPost.id DESC');
$Controller->constructClasses();
$results = Set::extract($Controller->paginate('ControllerPost'), '{n}.ControllerPost.id');
@ -881,7 +881,7 @@ class ControllerTest extends CakeTestCase {
$Controller = new Controller($request);
$Controller->uses = array('ControllerPost', 'ControllerComment');
$Controller->params['url'] = array();
$Controller->query = array();
$Controller->constructClasses();
$Controller->ControllerPost->virtualFields = array(
'offset_test' => 'ControllerPost.id + 1'
@ -1499,7 +1499,7 @@ class ControllerTest extends CakeTestCase {
$Controller->components = array("RequestHandler");
$Controller->modelClass='ControllerPost';
$Controller->params['url'] = array('ext' => 'rss');
$Controller->request->params['url'] = array('ext' => 'rss');
$Controller->constructClasses();
$Controller->Components->trigger('initialize', array(&$Controller));
$Controller->beforeFilter();