Not a bug XenForo_ControllerPublic_Page::actionIndex()

Fuhrmann

Well-known member
XenForo_ControllerPublic_Page::actionIndex()

The $nodeModel in the line 13 is not used in the whole action:

PHP:
public function actionIndex()
    {
        $nodeName = $this->_input->filterSingle('node_name', XenForo_Input::STRING);
        $page = $this->_getPageOrError($nodeName);
 
        $this->_canonicalizeRequestUrl($page);
 
        $pageModel = $this->_getPageModel();
        $nodeModel = $this->_getNodeModel();
 
        if ($page['log_visits'])
        {
            $pageModel->logVisit($page, XenForo_Visitor::getInstance()->toArray(), XenForo_Application::$time);
 
            $page['view_count']++;
        }
 
        $nodeBreadCrumbs = $this->_getNodeModel()->getNodeBreadCrumbs($page, false);
 
As there's no down side (and really, it just makes it easier in the future), not a bug. I wouldn't bother reporting things like this TBH.
 
Ok, then! :)

This just dont make sense to me: why put the model into a variable and then a few lines after call to the same function instead of the var?
 
Ok, then! :)

This just dont make sense to me: why put the model into a variable and then a few lines after call to the same function instead of the var?
Most of those functions call for a cached version, and if its not available, creates it and places it into the cache. So you actually only receive 1 instance (if I remember the code correctly).
 
Top Bottom