diff --git a/cake/libs/view/theme.php b/cake/libs/view/theme.php index 57642f358..d0745efa6 100644 --- a/cake/libs/view/theme.php +++ b/cake/libs/view/theme.php @@ -67,11 +67,8 @@ class ThemeView extends View { } $paths = array_merge($themePaths, $paths); } - - if (empty($this->__paths)) { - $this->__paths = $paths; - } - return $paths; + $this->__paths = $paths; + return $this->__paths; } } ?> \ No newline at end of file diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 854bcc1e5..7f56a14bb 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -609,7 +609,7 @@ class View extends Object { function entity() { $assoc = ($this->association) ? $this->association : $this->model; if (!empty($this->entityPath)) { - $path = explode('.',$this->entityPath); + $path = explode('.', $this->entityPath); $count = count($path); if ( ($count == 1 && !empty($this->association)) || @@ -944,12 +944,8 @@ class View extends Object { } $paths[] = App::pluginPath($plugin) . 'views' . DS; } - $paths = array_merge($paths, $viewPaths); - - if (empty($this->__paths)) { - $this->__paths = $paths; - } - return $paths; + $this->__paths = array_merge($paths, $viewPaths); + return $this->__paths; } } diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 6f52101f2..c8641a1cb 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -476,6 +476,13 @@ class ViewTest extends CakeTestCase { function testElement() { $result = $this->View->element('test_element'); $this->assertEqual($result, 'this is the test element'); + + $result = $this->View->element('plugin_element', array('plugin' => 'test_plugin')); + $this->assertEqual($result, 'this is the plugin element using params[plugin]'); + + $this->View->plugin = 'test_plugin'; + $result = $this->View->element('test_plugin_element'); + $this->assertEqual($result, 'this is the test set using View::$plugin plugin element'); $result = $this->View->element('non_existant_element'); $this->assertPattern('/Not Found:/', $result);