From 63bb042c9e335b0e547e79b6e55582acef5d1633 Mon Sep 17 00:00:00 2001 From: phpnut Date: Wed, 26 Dec 2007 02:20:47 +0000 Subject: [PATCH] "Fixes #3766, RequestAction fails on plugin to app and plugin to plugin" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6262 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/dispatcher.php | 5 ++++- cake/libs/object.php | 3 --- cake/tests/cases/dispatcher.test.php | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 3ead40f78..266b8b9a5 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -501,7 +501,10 @@ class Dispatcher extends Object { if (class_exists($ctrlClass)) { if (low(get_parent_class($ctrlClass)) === low($name . 'AppController')) { - $params = $this->_restructureParams($params); + $count = count(explode('/', $params['url']['url'])); + if ((isset($params['admin']) && $params['action'] === 'index') || (!empty($params['pass']) || $count > 2) || ($params['action'] !== 'index')) { + $params = $this->_restructureParams($params); + } $params = $this->_restructureParams($params, true); } $this->params = $params; diff --git a/cake/libs/object.php b/cake/libs/object.php index 237b8dbca..d23c81087 100644 --- a/cake/libs/object.php +++ b/cake/libs/object.php @@ -90,9 +90,6 @@ class Object { require CAKE . 'dispatcher.php'; } $dispatcher =& new Dispatcher(); - if (isset($this->plugin)) { - $extra['plugin'] = $this->plugin; - } if (in_array('return', $extra, true)) { $extra['return'] = 0; $extra['bare'] = 1; diff --git a/cake/tests/cases/dispatcher.test.php b/cake/tests/cases/dispatcher.test.php index 68827828b..7073f48ad 100644 --- a/cake/tests/cases/dispatcher.test.php +++ b/cake/tests/cases/dispatcher.test.php @@ -668,7 +668,6 @@ class DispatcherTest extends UnitTestCase { $expected = array(0 => 5, 'param'=>'value', 'param2'=>'value2'); $this->assertEqual($controller->passedArgs, $expected); - Router::reload(); Router::connect('/admin/:controller/:action/*', array('controller' => 'pages', 'action' => 'index', 'admin' => true, 'prefix' => 'admin'));