Jon W
Well-known member
In XenForo_Dependencies_Abstract:: preRenderView in XenForo 1.2.0 Beta 1, the last bit of code was changed from:
to:
However, the values controllerName and controllerAction are never actually set in the sub view (they are not added until the end of XenForo_FrontController::dispatch).
As a result, when you have debug mode enabled and hover over the loading timing link at the bottom of the page, you can only see the name of the view.
The code should therefore be something like:
PHP:
if ($controllerResponse)
{
$this->_defaultTemplateParams['controllerName'] = $controllerResponse->controllerName;
$this->_defaultTemplateParams['controllerAction'] = $controllerResponse->controllerAction;
$this->_defaultTemplateParams['viewName'] = $controllerResponse->viewName;
}
PHP:
if ($controllerResponse)
{
if ($controllerResponse instanceof XenForo_ControllerResponse_View && $controllerResponse->subView)
{
$this->_defaultTemplateParams['controllerName'] = $controllerResponse->subView->controllerName;
$this->_defaultTemplateParams['controllerAction'] = $controllerResponse->subView->controllerAction;
$this->_defaultTemplateParams['viewName'] = $controllerResponse->subView->viewName;
}
else
{
$this->_defaultTemplateParams['controllerName'] = $controllerResponse->controllerName;
$this->_defaultTemplateParams['controllerAction'] = $controllerResponse->controllerAction;
$this->_defaultTemplateParams['viewName'] = $controllerResponse->viewName;
}
}
However, the values controllerName and controllerAction are never actually set in the sub view (they are not added until the end of XenForo_FrontController::dispatch).
As a result, when you have debug mode enabled and hover over the loading timing link at the bottom of the page, you can only see the name of the view.
The code should therefore be something like:
PHP:
if ($controllerResponse)
{
if ($controllerResponse instanceof XenForo_ControllerResponse_View && $controllerResponse->subView)
{
$this->_defaultTemplateParams['viewName']= $controllerResponse->subView->viewName;
}
else
{
$this->_defaultTemplateParams['viewName']= $controllerResponse->viewName;
}
$this->_defaultTemplateParams['controllerName'] = $controllerResponse->controllerName;
$this->_defaultTemplateParams['controllerAction'] = $controllerResponse->controllerAction;
}