Skip to content
This repository
Browse code

Fix caching of paths when a plugin param is used.

Plugin paths should not be cached as it makes subsequent look-ups
behave incorrectly.
  • Loading branch information...
commit 0b9b23fe3839e502542f9b7709c8de4b29782af8 1 parent 69b1c33
Mark Story authored markstory committed

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  lib/Cake/View/View.php
7  lib/Cake/View/View.php
@@ -1007,7 +1007,10 @@ protected function _paths($plugin = null, $cached = true) {
1007 1007
 			$paths = array_merge($paths, App::path('View', $plugin));
1008 1008
 		}
1009 1009
 
1010  
-		$this->_paths = array_unique(array_merge($paths, $viewPaths, array_keys($corePaths)));
1011  
-		return $this->_paths;
  1010
+		$paths = array_unique(array_merge($paths, $viewPaths, array_keys($corePaths)));
  1011
+		if ($plugin !== null) {
  1012
+			return $paths;
  1013
+		}
  1014
+		return $this->_paths = $paths;
1012 1015
 	}
1013 1016
 }

0 notes on commit 0b9b23f

Please sign in to comment.
Something went wrong with that request. Please try again.