Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding bake skeleton's view directory to view paths list to avoid pro…

…mlems with existing installation due to file moving done in earlier commit.
  • Loading branch information...
commit 5c792aa831dfcdec73983257b12fd9f487116c86 1 parent df0d1d6
@ADmad ADmad authored
View
3  lib/Cake/Core/App.php
@@ -838,7 +838,8 @@ protected static function _packageFormat() {
'%s' . 'Controller' . DS . 'Component' . DS . 'Acl' . DS
),
'View' => array(
- '%s' . 'View' . DS
+ '%s' . 'View' . DS,
+ CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
),
'View/Helper' => array(
'%s' . 'View' . DS . 'Helper' . DS
View
3  lib/Cake/Test/Case/Core/AppTest.php
@@ -156,7 +156,8 @@ public function testCompatibleBuild() {
App::build(array('views' => array('/path/to/views/')));
$expected = array(
'/path/to/views/',
- APP . 'View' . DS
+ APP . 'View' . DS,
+ CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
);
$result = App::path('views');
$this->assertEquals($expected, $result);
View
1  lib/Cake/Test/Case/View/ViewTest.php
@@ -403,6 +403,7 @@ public function testPluginPathGeneration() {
$expected = array(
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugin' . DS . 'TestPlugin' . DS,
$pluginPath . 'View' . DS,
+ CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS,
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS,
CAKE . 'View' . DS
);
View
15 lib/Cake/View/View.php
@@ -1097,15 +1097,14 @@ protected function _paths($plugin = null, $cached = true) {
$paths = array_unique(array_merge($paths, $viewPaths, array_keys($corePaths)));
if (!empty($this->theme)) {
$themePaths = array();
- $count = count($paths);
- for ($i = 0; $i < $count; $i++) {
- if (strpos($paths[$i], DS . 'Plugin' . DS) === false
- && strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) {
- if ($plugin) {
- $themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
- }
- $themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS;
+ foreach ($paths as $path) {
+ if (strpos($path, DS . 'Plugin' . DS) === false
+ && strpos($path, DS . 'Cake' . DS . 'View') === false) {
+ if ($plugin) {
+ $themePaths[] = $path . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
}
+ $themePaths[] = $path . 'Themed'. DS . $this->theme . DS;
+ }
}
$paths = array_merge($themePaths, $paths);
}
Please sign in to comment.
Something went wrong with that request. Please try again.