Skip to content

Commit

Permalink
Merge pull request #3045 from mtschirs/patch-13
Browse files Browse the repository at this point in the history
Remove calls to viewLocation() from Gdn_Controller
  • Loading branch information
tburry committed Sep 2, 2015
2 parents 2ca704d + 4db600c commit bd269e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 0 additions & 12 deletions library/core/class.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,6 @@ public function fetchViewLocation($View = '', $ControllerName = false, $Applicat
$View .= '_rss';
}

$ViewPath2 = viewLocation($View, $ControllerName, $ApplicationFolder);

$LocationName = concatSep('/', strtolower($ApplicationFolder), $ControllerName, $View);
$ViewPath = arrayValue($LocationName, $this->_ViewLocations, false);
if ($ViewPath === false) {
Expand Down Expand Up @@ -851,10 +849,6 @@ public function fetchViewLocation($View = '', $ControllerName = false, $Applicat
// trigger_error(ErrorMessage("Could not find a '$View' view for the '$ControllerName' controller in the '$ApplicationFolder' application.", $this->ClassName, 'FetchViewLocation'), E_USER_ERROR);
}

if ($ViewPath2 != $ViewPath) {
Trace("View paths do not match: $ViewPath != $ViewPath2", TRACE_WARNING);
}

return $ViewPath;
}

Expand Down Expand Up @@ -1817,8 +1811,6 @@ public function renderMaster() {
// Master views come from one of four places:
$MasterViewPaths = array();

$MasterViewPath2 = viewLocation($this->masterView().'.master', '', $this->ApplicationFolder);

if (strpos($this->MasterView, '/') !== false) {
$MasterViewPaths[] = combinePaths(array(PATH_ROOT, str_replace('/', DS, $this->MasterView).'.master*'));
} else {
Expand Down Expand Up @@ -1846,10 +1838,6 @@ public function renderMaster() {
}
}

if ($MasterViewPath != $MasterViewPath2) {
trace("Master views differ. Controller: $MasterViewPath, ViewLocation(): $MasterViewPath2", TRACE_WARNING);
}

$this->EventArguments['MasterViewPath'] = &$MasterViewPath;
$this->fireEvent('BeforeFetchMaster');

Expand Down
2 changes: 2 additions & 0 deletions library/core/functions.general.php
Original file line number Diff line number Diff line change
Expand Up @@ -3771,8 +3771,10 @@ function url($Path = '', $WithDomain = false, $RemoveSyndication = false) {
* @param string $Controller The name of the controller invoking the view or blank.
* @param string $Folder The application folder or plugins/plugin folder.
* @return string|false The path to the view or false if it wasn't found.
* @deprecated
*/
function viewLocation($View, $Controller, $Folder) {
deprecated('viewLocation()');
$Paths = array();

if (strpos($View, '/') !== false) {
Expand Down

0 comments on commit bd269e2

Please sign in to comment.