Lack of interest Output throws error if a nodehandler doesn't exist

  • Thread starter Thread starter ragtek
  • Start date Start date
This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.
R

ragtek

Guest
In XenForo_Model_Node::getNodeHandlersForNodeTypes you check if the handler class for the nodetypeid is set.
If it isn't set, you set the classname as an empty string.
PHP:
    public function getNodeHandlersForNodeTypes(array $nodeTypeIds)
    {
        $nodeTypes = $this->getAllNodeTypes();

        $output = array();
        foreach ($nodeTypeIds AS $nodeTypeId)
        {
            $class = isset($nodeTypes[$nodeTypeId]) ? $nodeTypes[$nodeTypeId]['handler_class'] : '';
            $output[$nodeTypeId] = new $class();
        }

        return $output;
    }

That brings an ugly fatal error
Fatal error: Class '' not found in D:xampp\xampp\htdocs\xf\library\XenForo\Model\Node.php on line 515
if it's not set.
IMHO this shouldn't brake the system.
I know, this will only happen if the add-on deinstall code isn't deleting the existing nodes, but maybe you could use here a "empty alias node handler" class for this?
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Top Bottom